Forum Moderators: coopster

Message Too Old, No Replies

$ SESSION question

         

Modern Merlin

10:11 pm on Aug 31, 2008 (gmt 0)

10+ Year Member



Ok so I got the php script I am using to use a session variable and write to the database a 1 showing the person online. Now the question I have is how do I get it to write back to the database a 0 to show them offline. I know I can do it with a logout button but what about those people who close the browser without logging out?

Any help would be awesome! Thanks!

MM

eelixduppy

10:20 pm on Aug 31, 2008 (gmt 0)



I believe you can use a custom session handler, and store the session information in a database that way when the session is destroyed (logout or browser closed) the destroy and garbage collector functinos will be called and you can do what you want. Take a look: [php.net...]

Modern Merlin

12:57 am on Sep 1, 2008 (gmt 0)

10+ Year Member



Thanks! Ill check it out and let you know how it goes!