[thelist] PHP Session Variables

R.Livsey R.Livsey at cache-22.co.uk
Tue Apr 23 11:00:01 CDT 2002


> Greetings group!
>
> I have a set of PHP pages that use session variables for a
> number of things. Rather than pass the session ID through the
> URL I usually place <? session_start(); ?> at the top of each
> page. While this works, I am afraid that I am starting new
> sessions for each page visited during the user's visit. Is
> there a better, more acceptable, cleaner, less resource
> intensive way to do this? I have searched for examples, but
> can find none in either books or online (unless I am
> misreading some of the information I have seen).
>
> TIA!
>
> Jay

Hi

>From : http://www.php.net/manual/en/function.session-start.php

session_start() creates a session (or resumes the current one based on
the session id being passed via a GET variable or a cookie).

So basically it checks to see if a session is already setup before
initiating a new one - hence why the session_id will constant across the
site for that user.

Hth

--
R.Livsey




More information about the thelist mailing list