Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i get a SESSION to last longer then browser close?

Status
Not open for further replies.

unborn

Programmer
Joined
Jun 26, 2002
Messages
362
Location
US
i set sessions and i found out its not my coding.. its just that the sessions arent staying set. they only stay set while the page is open but if you close and go back the sessions are gone.

i can supply code if needed i rewrote my code thinking it was the code and it is totally diffrent but it seems liek it shoudl work better then the other code.. but it wont last past browser close either. thanks for looking it over.

in the begining man created code.
in the end code will create man.
clones are coming only matter of time.
examples?
 
I did a quick thing where I wrote the info to a cookie as well as the session, and if I couldn't pull the stuff out of the session, I tried the cookie. You have to make sure you clear both if the user logs out though.
 
there is no log out really just they visit the page and the page remembers what bg they last used.

so is keeping sessions after bar being closed not standard? and where can i learn about using cookies? thanks

in the begining man created code.
in the end code will create man.
clones are coming only matter of time.
examples?
 
The lifetime of a session cookie is set by the php.ini runtime configuration directive "session.cookie_lifetime", which is the lifetime, in seconds, of a session cookie. This setting has a default value of 0 (zero) which means the cookie only lasts until the browser is shut down.

The manual categorizes "session.cookie_lifetime" as a PHP_INI_ALL-type setting, which means it can be changed in php.ini, in a httpd.conf, in a .htaccess file and through the use of ini_set().

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top