Re: session

From: Date: Thu, 06 Sep 2001 13:18:35 +0000
Subject: Re: session
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-66213@lists.php.net to get a copy of this message
First of all, we look a little bit on your code.. It should be something like this: code ----------- <?php if (true == session_is_registered("main_session_variable") { session_unregister('sessie_loginnaam'); session_unregister('sessie_status'); session_unregister('sessie_url'); session_destroy(); } ----more code--- session_start(); session_register('sessie_loginnaam'); session_register('sessie_status'); session_register('sessie_url'); ?> The big clue is to have a session variable that uniquely identifies the session. (think like you're dealing with a damn database =) ). And before I forget... DO NOT use start() and destroy() in the same script... It will only generate mess and yet more mess.. Good luck, André "Wilbert Enserink" <wilbert@pdd.nl> wrote in message news:01a901c136d2$f72f7880$0301a8c0@168.1.1... hi all, i'm trying to use session variables. people can login using a loginform. if they are already logged in I want the previous session to be destroyed before the new session starts. if it's their first login the session shoulds also start. if I first login with name1/password1 I give url1 back If I then login with name2/password2, url2 should be given back, however when I print all sessionvariables they are still filled with the properties of the first login (also url1). Is there some way to avoid this problem? it seems that the sessionvariables are not really destroyed. Or is it that i'm using both session commands (start and destroy) in the same script. thx to anyone who can shine a light on this... Wilbert Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl info@pdd.nl -------------------------

« previous php.general (#66213) next »