I have a site that is using $_SESSION['variablename'] for many variables that are loaded when the user first enters the site (index.php), and then referenced on each page (display.php):

ex:     index.php
        session_start();
        $agencyID=9;
        $agencyName="fremont";
        $_SESSION['agencyID'] = $agencyID;
        $_SESSION['agencyName'] = $agencyName;

ex:     display.php
        session_start();
        $agencyID=$_SESSION['agencyID'];
        $agencyName=$_SESSION['agencyName'];

But after awhile, the session seems to fail and I end up back at the index page because the $agencyID gets voided. Is there a timeout on sessions other than closing the browser? If so, is there a way to set timeout if one doesn't have server admin access? Should I be doing something like:

ex:     display.php
        session_start();
        $agencyID=$_SESSION['agencyID'];
        $agencyName=$_SESSION['agencyName'];
        $_SESSION['agencyID'] = $agencyID;
        $_SESSION['agencyName'] = $agencyName;

to update the session variables with each page?

Terry

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to