NYCPHP Meetup

NYPHP.org

[nycphp-talk] Checking active sessions

David Krings ramons at gmx.net
Mon Apr 23 20:20:04 EDT 2007


David Krings wrote:
> Hi!
> 
> Is there any way I can check which sessions are currently active and 
> which aren't? I like to add some housekeeping code, but taking away 
> things from active sessions would be just mean.
> 

OK! Apparently my question was so stupid that nobody could produce an 
answer that low to reach my level. So I do it myself. ;)
My plan is to create a session, authenticate the user, then generate a 
new session ID for the session )I read that this improves security and 
is easy enough to do), write that to a table with a time stamp and upon 
login (who bothers to log out correctly??) check the timestamps against 
now and make a decision if the session is stale and can have its temp 
folder ditched. That way I keep track of 'my' sessions rather than 
trying to figure out which ones are mine from all the sessions the 
server may have.

Sounds reasonable? Standard practice? OK, maybe, but I'm doing this for 
the first time and try to write and understand the code myself. Copying 
is cheating, reinventing the wheel is so much more fun....for a hobbyist 
like me.

Thanks for not answering and making me think about this a few days. No 
really, that was much better than getting an answer in five minutes.


David



More information about the talk mailing list