Hello,
just a description of how it work in my cp app.
I receive a create_session message only if a client works
without
cookies.
In this case the client gives a sessionId as an additional
parameter.
In my on_create_session handler I check the sessionId and
fill a
translation map that I use in my RamSession class at the
load(self,
sessionId) function.
In my on_create_session handler I would like to return the
"real"
session id. Then cp continues with the already exciting and
really
requested session. Like this:
def on_create_session(self, session_data):
newSessionId = session_data["_id"]
try:
wantedSession =
cherrypy.request.params['sessionId']
self.sessionMap[newSessionId] = wantedSession
print "Wanted session is NOT the same:
", wantedSession
except:
wantedSession = newSessionId
print "Wanted session is same: ",
wantedSession
# suggestion!
return wantedSession
Or is there a way to do this more elegant?
Thanks,
Marcus
remi cherrypy.org schrieb:
> > If someone will confirm that this is indeed a bug,
I'll work on a
> > patch. I would file a bug report on Trac, but
that doesn't seem
> > currently possible(?).
>
> I think that the confusion comes from the distinction
between creating
> a session and "renewing" an expired
session.
>
> If your session is expired and you try to access a
page, CP will keep
> the existing session ID and create some new data. In
that case
> "on_create_session" will not get called
because technically, no new
> session ID is created.
>
> I see 3 possibilities:
> - Add a new "on_renew_session" (or
something similar) callback
> - Call "on_create_session" even if it's
just an old session being
> re-used
> - Don't reuse expired session IDs and create new ones
instead.
>
> Feedback ?
>
> Remi.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at http://
groups.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---
|