Page 1 of 1

What do i do here?

Posted: Sat Sep 01, 2007 11:57 am
by SirChick
I have a global include with session_start();
which is on every page.

Now say i have a page putting variables into a session i have to put session_start() on top of that page too but then i get the error along the lines of :

Session already started, ignoring session in (the global include)...on line 2.


I cannot remove the session from include how ever as that is what keeps the UserID in the session to be used when needs be through out the site... ?

What should i do? Have any of you had this similiar issue?

Posted: Sat Sep 01, 2007 12:19 pm
by superdezign
session_start() isn't file-specific. It can be used once per page request.

Posted: Sat Sep 01, 2007 12:21 pm
by SirChick
so if i only have session_start() in the include providing it is infact included then the session will work ?

Posted: Sat Sep 01, 2007 12:44 pm
by volka
yes, after that session_start() is executed.