Re: Assist with session persistance

From: Date: Tue, 23 Dec 2003 17:12:36 +0000
Subject: Re: Assist with session persistance
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-173257@lists.php.net to get a copy of this message
The directive session.cookie_lifetime in your php.ini is what a session cookie timeout defaults to. You can manually set the lifetime when you create it using session_set_cookie_params(). http://us3.php.net/manual/en/function.session-set-cookie-params.php -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: mgrimm@healthtvchannel.org Web: www.healthtvchannel.org "Terry Romine" <eatrom@blazing-trails.com> wrote in message news:96BE9DB1-3569-11D8-AE20-00306573821E@blazing-trails.com... > 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

« previous php.general (#173257) next »