Re: How do sessions work exactly?

From: Date: Fri, 28 Jul 2000 09:22:12 +0000
Subject: Re: How do sessions work exactly?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-8748@lists.php.net to get a copy of this message
Sessions save the variables you tell it to for each unique user accessing your website. For example, if you ask for a username and password then you can verify the users identity. Once you have done that, save variables to that users session such as the ID for their record in your data table of users. On succeeding pages you can check if these variables have been set, thereby verifying the user's identity. At 04:07 AM 7/28/00 -0400, Generic Player wrote:
I am way lost on sessions. What I am trying to do is have a cookie identify a message board poster. But to prevent people from being able to make their own cookies with someone else's identity contained, I don't want to use a plain old cookie to store their identity. If I understand corectly, a session would send a cookie that contains a unique ID string, and that ID string would the be associated with the variables stored on my server. Is this correct? Assuming that's how its supposed to work, how do I make it work like that? The persons identity will already be stored in a mysql database, can I have the session point to the database itself? What I am doing so far is just using session_register($name, $blarg) in the registering script. So if they register blarg is set to 1, and stored with the name they used as the session. Then, in theory I should be able to call those variables in other pages used to actually post messages right? What exactly do I need to do to be able to access them from the other pages? All I have is session_start() at the beggining of the other pages, and that's not working. Thanks for any help Generic Player -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net


« previous php.general (#8748) next »