Page 1 of 1

destroy sessions

Posted: Sun Apr 18, 2004 1:55 pm
by potato
is there a function that i can use to destroy all the sessions on the server?

Posted: Sun Apr 18, 2004 2:09 pm
by MarK (CZ)
Delete all the files in the sessions folder.

Posted: Sun Apr 18, 2004 2:14 pm
by John Cartwright
session_destroy(); to delete them
session_unset(); to unset them

Posted: Sun Apr 18, 2004 3:34 pm
by MarK (CZ)
Phenom wrote:session_destroy(); to delete them
session_unset(); to unset them
But that concerns only one session, not all on the server. I think.

Posted: Sun Apr 18, 2004 3:43 pm
by tim
MarK (CZ) wrote:
Phenom wrote:session_destroy(); to delete them
session_unset(); to unset them
But that concerns only one session, not all on the server. I think.
I think you couldnt be more wrong.

a better way of clearing sessions is:

Code: Select all

<?php
$_SESSION = array();
session_destroy();
?>

Posted: Sun Apr 18, 2004 3:52 pm
by MarK (CZ)
So if you use 'session_destroy()' it will erase ALL session data from ALL users connected to the server??

Posted: Sun Apr 18, 2004 8:57 pm
by John Cartwright

Code: Select all

<?php

$_SESSION = array(); 
session_destroy(); 

?>
whats the difference from
session_destroy();

Posted: Sun Apr 18, 2004 9:51 pm
by feyd
why not set garbage collection to 100% in the ini?