Project

General

Profile

Bug #2471 ยป r.cpp

Boris Nagaev, 11/27/2013 11:40 PM

 
#include <iostream>

#include <Wt/WApplication>
#include <Wt/WImage>
#include <Wt/WResource>
#include <Wt/WLink>
#include <Wt/Http/Request>

using namespace Wt;

class MyResource : public WResource {
void handleRequest(const Http::Request& request,
Http::Response& response) {
std::cerr << "==== Cookies: " << request.headerValue("Cookie") << "\n";
std::cerr << "==== Number of cookies: " << request.cookies().size() << "\n";
}
};

class MyApp : public WApplication {
public:
MyApp(const WEnvironment& env):
WApplication(env) {
setCookie("test", "test", 100500);
MyResource* res = new MyResource;
addChild(res);
WImage* image = new WImage(res->url(), root());
}
};

WApplication* createMyApp(const WEnvironment& env) {
return new MyApp(env);
}

int main(int argc, char** argv) {
return WRun(argc, argv, createMyApp);
}
    (1-1/1)