[UPHPU] sessions in front controller

Alvaro Carrasco alvaro at epliant.com
Tue Oct 10 11:28:43 MDT 2006


jtaber wrote:
> having mental blockage on this one:
> a front controller has a session_start() to initialize the session but 
> each time a page is called the session_start()  gets called again 
> which seems to wipe out the session vars - tried to wrap the 
> session_start() ie
>
> if (!isset($_SESSION['start'])) {
> session_start();
> $_SESSION['start']=1;
> }
> .... test for right session
> .....
>
> is this right ?  does anyone have an example of using session in a 
> front controller (sorry google search wasn't showing me any good 
> examples).  thks
>
>
>
session_start() does not clear the session vars, and it is actually 
required on every single page that uses the session.
There must be some other code in your php that is clearing the session 
vars.
You might also want to check the ini settings related to session.

Alvaro



More information about the UPHPU mailing list