Re: Session Confusion

From: Date: Fri, 23 Mar 2001 20:59:31 +0000
Subject: Re: Session Confusion
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-45341@lists.php.net to get a copy of this message
Hi, All the session functions check to see if you have a session running first before starting a session, to prevent you from starting two sessions by accident. If for some reason you want to start another session, you can do that by supplying your own session id to the function session_start() to start another session. However, you do not need to do that for your purposes. You can start the only session you need when they submit their form info, and to keep them from signing up twice, before you record the data use an if statement to check if there is a session(if ($PHPSESSID)). If there is already a session, do not record the data, and display a message: "You have already signed up, proceed to login." and redirect them to the login page.

« previous php.general (#45341) next »