PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
potato
Forum Contributor
Posts: 192 Joined: Tue Mar 16, 2004 8:30 am
Location: my lovely trailer, next to the big tree
Post
by potato » Sun Apr 18, 2004 1:55 pm
is there a function that i can use to destroy all the sessions on the server?
MarK (CZ)
Forum Contributor
Posts: 239 Joined: Tue Apr 13, 2004 12:51 am
Location: Prague (CZ) / Vienna (A)
Contact:
Post
by MarK (CZ) » Sun Apr 18, 2004 2:09 pm
Delete all the files in the sessions folder.
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Sun Apr 18, 2004 2:14 pm
session_destroy(); to delete them
session_unset(); to unset them
MarK (CZ)
Forum Contributor
Posts: 239 Joined: Tue Apr 13, 2004 12:51 am
Location: Prague (CZ) / Vienna (A)
Contact:
Post
by MarK (CZ) » Sun Apr 18, 2004 3:34 pm
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.
tim
DevNet Resident
Posts: 1165 Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio
Post
by tim » Sun Apr 18, 2004 3:43 pm
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();
?>
MarK (CZ)
Forum Contributor
Posts: 239 Joined: Tue Apr 13, 2004 12:51 am
Location: Prague (CZ) / Vienna (A)
Contact:
Post
by MarK (CZ) » Sun Apr 18, 2004 3:52 pm
So if you use 'session_destroy()' it will erase ALL session data from ALL users connected to the server??
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Sun Apr 18, 2004 8:57 pm
Code: Select all
<?php
$_SESSION = array();
session_destroy();
?>
whats the difference from
session_destroy();
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sun Apr 18, 2004 9:51 pm
why not set garbage collection to 100% in the ini?