FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

php sessions

 


nunosilva
guys I'm having a hard time here with sessions...

I create a session... lol that's easy...
but when I logoff i'd like to end the session... but how?
everytime I log on with another username, it's like I've been using the previous session...
mathiaus
If you close your browser or go to a different website then go back the session should've gone. If however your logging out using a script then carrying on it isnt logging you out properly. Try using this

Code:
$_SESSION = array();
session_destroy();
SystemWisdom
Or if you would like to just end the session (but not destroy all registered session data) then you could use session_write_close() instead of session_destroy()..

Background info:
session_destroy()
session_write_close()

I hope that helps some..
brosta
my logout.php consist of:
Code:

session_start();
$_SESSION = array();
session_destroy();
header("Location: index.php");
nunosilva
that looks nice brosta Very Happy
It's kinda like mine, but without session_start()...
no wonder I couldn't end it...
This topic is locked: you cannot edit posts or make replies.    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.