Re: [PHP] Assist with session persistance

2003-12-23 Thread John W. Holmes
Terry Romine wrote:


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? 
Session timeout is controlled by the session.gc_maxlifetime setting. 
It's the number of seconds after which session files will be seen as old 
and removed (if they aren't accessed in that time).

If you want the session to persist outside of the browser closing, then 
you can set the lifetime of the session cookie. Be sure to raise 
gx_maxlifetime to match what you set the cookie lifetime to, also.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] Assist with session persistance

2003-12-23 Thread Matt Matijevich
[snip]
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:
[/snip]

There is a session timeout. http://ch.php.net/session take a look at
the variable session.gc_maxlifetime . I am not sure how to change this
if you dont have admin access.

You could store the session info in a db and right your own clean up
routines.

I think you can skip this:
$agencyID=9;
$agencyName="fremont";

and just do this:
$_SESSION['agencyID'] = 9;
$_SESSION['agencyName'] = "fremont";

then just use the $_SESSION vars in your scripts.

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



[PHP] Assist with session persistance

2003-12-23 Thread Terry Romine
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