Re: [Cgi-session-user] MySQL backend - multiple copies of session id's stored?
Brought to you by:
sherzodr
From: Mark S. <ma...@su...> - 2006-07-29 13:12:03
|
Justin Simoni wrote: > Hey everyone, > > before I delve any further into a problem I'm having, > > Is it normal for the MySQL backend to store multiple copies of the > session in a MySQL backend? No. But read the source of the MySQL driver module to confirm for yourself. It's rather simple. > I've had some bug reports: > > http://sourceforge.net/tracker/index.php?func=detail&aid=1525557&group_id=13002&atid=113002 The bug report clarifies something. It's not /duplicate/ sessions are being saved, but rather, lots of new, different sessions. That sounds like it might be an application error. Review the calls to CGI::Session->new(). Add debugging statements near there and try again. That should clarify who is at fault. Remember that's fine for the same session to be used before and after someone logs in. The difference might be the presence of "logged_in => 1" in the session. (And random suggestion: The YAML serializer creates output that is a lot nicer to look it for debugging than the default one. ) > Given the advice of the docs and this list, every change done to the > sessions - adding/editing/removing is followed by a ->flush method > call. I'm willing to make a test up that I'll try running, but first > wanted to see if this is behavior is actually wrong. I think flush() just means "synchronize memory with disk". So this design is OK. In theory, doing it once at the end of the request cycle would be sufficient, or just before you need to run a DB query that depends on the flushed state() > My program is of course, pretty meaty, I like to think of it a "pretty tofuey" or just "high in protein". Mark -- http://mark.stosberg.com/ |