From: Gonzalo A. <ga...@us...> - 2006-09-12 00:26:12
|
Update of /cvsroot/mod-c/ehtml/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv4084/src Modified Files: Session.cpp Log Message: * Added SessionID(MemBuf& mb) constructor. * Added bool Session::Expired() method. Index: Session.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/Session.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Session.cpp 8 Sep 2006 14:30:59 -0000 1.12 --- Session.cpp 12 Sep 2006 00:26:09 -0000 1.13 *************** *** 27,30 **** --- 27,31 ---- string Session::_session_id_name( "ehtmlSID" ); + bool Session::_cookie_less = false; DECLARE_PLUGIN(SessionDriver); *************** *** 51,54 **** --- 52,62 ---- } + SessionID::SessionID(const MemBuf& mb): _binary(mb) { + _binary_set = 1; + _base64_set = 0; + _hex_set = 0; + _url_set = 0; + } + SessionID::SessionID(void* b, size_t nbytes, bool dup): _binary(b,nbytes) { if (dup) *************** *** 258,266 **** const string* id = Session::CookieLess() ? req->GetArgument(Session::SessionIDName()) : ! req->GetArgument(Session::SessionIDName()); ! /* @TODO req->GetCookie(Session::session_id_name()) */ ! //@todo TODO: MUST USE CONFIGURATION DIRECTIVE TO SEE WHICH ENCODING ! //IS TO BE USED. ! return id ? Get(SessionID((void*)id->c_str(), id->length())) : NULL; } --- 266,275 ---- const string* id = Session::CookieLess() ? req->GetArgument(Session::SessionIDName()) : ! req->GetCookie(Session::SessionIDName()); ! if (!id) ! return NULL; ! SessionID sid(hexdecode(*id)); ! printf("got sessionid = %s\n", sid.hex().c_str()); ! return Get(sid); } *************** *** 293,296 **** --- 302,306 ---- istream& operator >> (istream& i, Session& s) { i >> *static_cast<Dictionary*>(&s); + printf("Expires=%s\n",s["$$__EXPIRES$$"].c_str()); s.Expires(xatoul(s["$$__EXPIRES$$"].c_str())); s.erase("$$__EXPIRES$$"); |