Session Confusion

From: Date: Fri, 23 Mar 2001 15:46:55 +0000
Subject: Session Confusion
Groups: php.general 
Request: Send a blank email to php-general+get-45297@lists.php.net to get a copy of this message
Ok these sessions have got me all confused, I need to have two seperate sessions one for when a user signs up, to stop them using there back button and inadvertantly signing up twice. And then one when they login. Both of them work great as standalone but if say I went and log into my account and then decide I need another, the sign up page blocks me because I already have a session running. Here is some code will probably help me explain my system. if(!$PHPSESSID) { $SET=1; }elseif($PHPSESSID=1) { echo"<CENTER>You are already Registered, please click <A HREF='login.php'>here </A> to login.</CENTER>"; die; } if($SET=1) { session_start(); session_register("SET"); } This checks to see if there is a session running, if there is it blocks them and sends them to the log in page, if there isn`t the rest of my script sets up the account and then forwards them to the log in screen, so if for any reason they decide to use there back button they can`t create two accounts by accident. Then when they log in I start a session as follows: session_start(); session_register("UserName","Password"); header ("Location: Http://www.tothemembersarea.com/"); So if I go to my system log in and then try to setup a new account it blocks me, any idea how I can distinguish between the two?? TIA Ade

« previous php.general (#45297) next »