Jump to content

Archived

This topic is now archived and is closed to further replies.

fletchsod

Session: destroying the sessions & sessions' tmp file...

Recommended Posts

Everytime the session_destory() is issued, the /tmp/sess_*** files with the same session_id() are still there...

Why does it not get destroyed?? How do we properly destroy it? I sometime wonder about trying to destroy the sessions in the memory as well (via session.save_handlers = "mm")...

This is what I get...

--snip--
Warning: Session object destruction failed in php_library.inc on line 126
--snip--

Thanks,
Scott

Share this post


Link to post
Share on other sites
You cannot delete or remove the session file generated with session_destroy. session_destory clears all the contents that is in the session file.

Also when you destroy the session you can use the [a href=\"http://uk2.php.net/manual/en/function.session-regenerate-id.php\" target=\"_blank\"]session_regenerate_id[/a] function which regenerate the session id, therefore when the session is destroyed the old session_id is invalid.

Share this post


Link to post
Share on other sites
Interesting... I have read reports that some php developers had successfully destory the tmp session file via "session_destory()" command...

Share this post


Link to post
Share on other sites
I suspect that they have used the [a href=\"http://uk.php.net/manual/en/function.session-set-save-handler.php\" target=\"_blank\"]session_set_save_handler[/a] functiion which allows you to define how you want session_destory to react when called. Such as it deletes the session file, rather than clearing contents of the file. In order to delete the session you need to make sure you have the correct permission set on both the folder that stores the session files and the session file it self you are about to delete.

Thats probably they did it.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.