26716Maintaining state with PHP4 sessionshttp://www.wdvl.com/Authoring/Languages/PHP/Maintaining_state/In order for an online store to keep track of what's in whose shopping trolley, the system needs to know which user is making specific requests. After users log in, they would get lost amongst all the other users if you didn't keep track of their session. By assigning a unique value to this user, the system can know who it is without having them log in on every pagePHP > Tips and Tutorials > User AuthenticationOct 16, 2006
First off I'd like to explain what a session is, in case you don't know what it is. A session begins when a user surfs into your website and ends when the user leaves your website (or one of your webpages terminates it explicitly). Essentially, a cookie is associated with a browser, and some kind of storage resource is allocated on the server to hold session variables. PHP4 uses files to store session variables, but one could theoretically use a database or shared memory to do the same.
The first and (possibly) the most important step is to have a logical way to group user data - a lot of people will push different forms on to you, but, in the end - whatever works best for you is the way you should do things
In order for an online store to keep track of what's in whose shopping trolley, the system needs to know which user is making specific requests. After users log in, they would get lost amongst all the other users if you didn't keep track of their session. By assigning a unique value to this user, the system can know who it is without having them log in on every page
Joining mailing list will entitle you
to receive occasional emails informing you of news and
updates to the site and any special offers that may be
of interest to you.