Re: [Cppcms-users] session question about cppcms
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2011-11-20 10:06:10
|
Hello, Make sure you update the session **before** any output is written. The session is saved on first access to response().out() as Cookies should be send in HTTP headers before the content. Also take a look on server response that sets the session see if it includes proper cookie. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.sf.net/ CppDB - C++ SQL Connectivity: http://cppcms.sf.net/sql/cppdb/ >________________________________ > From: 陈抒 <csf...@gm...> >To: cpp...@li... >Sent: Sunday, November 20, 2011 11:56 AM >Subject: [Cppcms-users] session question about cppcms > > >Hello, > I try to save an email address of current user into session after he logs into web server correctly.Here is my codes: >... >this->session()["email"]=user->email; >BOOSTER_INFO("hello") <<"session has email now:"<<this->session()["email"]; >... > > Then I refresh the page,and debug into my application,but can't find the email from session > >void hello::welcome(std::string url){ > BOOSTER_INFO("hello") << "Enter welcome function"; > if(session().is_set("email")){ > string email = this->session().get(string("email")); > c_.email = email; > } > render("my_skin","message",c_); >} > > > session().is_set("email") returns false; > > >My session configuration looks like so: > "session" : { >"expire" : "renew", >"timeout" : 600, >"location" : "server", >"server":{ > "storage":"memory" >} > } > > > > > > >陈抒 >Best regards >http://blog.csdn.net/sheismylife > >------------------------------------------------------------------------------ >All the data continuously generated in your IT infrastructure >contains a definitive record of customers, application performance, >security threats, fraudulent activity, and more. Splunk takes this >data and makes sense of it. IT sense. And common sense. >http://p.sf.net/sfu/splunk-novd2d >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |