2018-06-19 16:55:25 +08:00
|
|
|
#include <drogon/Cookie.h>
|
|
|
|
#include <iostream>
|
|
|
|
int main()
|
|
|
|
{
|
2018-10-14 15:56:54 +08:00
|
|
|
drogon::Cookie cookie1("test", "1");
|
|
|
|
std::cout << cookie1.cookieString();
|
|
|
|
drogon::Cookie cookie2("test", "2");
|
2018-06-19 16:55:25 +08:00
|
|
|
cookie2.setEnsure(true);
|
2018-10-14 15:56:54 +08:00
|
|
|
std::cout << cookie2.cookieString();
|
|
|
|
drogon::Cookie cookie3("test", "3");
|
2018-06-19 16:55:25 +08:00
|
|
|
cookie3.setDomain("drogon.org");
|
2018-10-14 15:56:54 +08:00
|
|
|
cookie3.setExpiresDate(trantor::Date::date().after(3600 * 24));
|
|
|
|
std::cout << cookie3.cookieString();
|
2018-11-16 13:26:14 +08:00
|
|
|
}
|