FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free 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...
Related topics
php sessions for different accounts
php sessions
PHP: Sessions and Cookies
PHP Sessions
PHP sessions and security
php SESSIONS question
PHP Sessions Issue
PHP Session Timeout/Max Life Time
problems for indexing php pages in google.
How to make a log in log out system for a website??
$_COOKIE and $_SESSION help needed!
friendster issue
Trying to start out!!!
is there session in perl
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-2011 Frihost, forums powered by phpBB.