Sessions time out after a specified time (set to 15 mins by default? correct me if I'm wrong). Try if a session timeout = session destroy. If so: tutto bene, you're sorted.
If not, and you're running mySQL, I'd set up a 30 min cron job to clean up the table.
[SOLVED]Sessions Help
Moderator: General Moderators
- Pyrite
- Forum Regular
- Posts: 769
- Joined: Tue Sep 23, 2003 11:07 pm
- Location: The Republic of Texas
- Contact:
Well, session destroy is already automatically called by php when the thing times out. But yea, either the cron job or the query I just posted seem like the only ways. I figure if there was an easy way to do it, phpBB would have the answer in their code, but they don't either.
Is it possible for me to scan through every session file on the server and pull out the user names of the people logged in?
Is it possible for me to scan through every session file on the server and pull out the user names of the people logged in?
Sorry, my mistake. I was, for some reason, thinking that session_destroy() would be automatically called on session timeout.
You have to use the garbage collection to clean up your session table.
In the custom session-functions (see php manual) you have a function called garbage collection. That will get called when the session times out. Write your SQL query that deletes the data from the session table there.
Zend has a tutorial on this: http://www.zend.com/zend/tut/session.php
Does that help with your problem?
You have to use the garbage collection to clean up your session table.
In the custom session-functions (see php manual) you have a function called garbage collection. That will get called when the session times out. Write your SQL query that deletes the data from the session table there.
Zend has a tutorial on this: http://www.zend.com/zend/tut/session.php
Does that help with your problem?
- Pyrite
- Forum Regular
- Posts: 769
- Joined: Tue Sep 23, 2003 11:07 pm
- Location: The Republic of Texas
- Contact:
Yes, now that is exactly what I wanted to know. I'll try to implement my own session handler with a garbage collection function and will let you know if it works. Thanks!
The other tutorial on Zend is probably better at explaining this.
http://www.zend.com/zend/spotlight/code ... -wade8.php
The other tutorial on Zend is probably better at explaining this.
http://www.zend.com/zend/spotlight/code ... -wade8.php