optikalefx Posted February 6, 2009 Share Posted February 6, 2009 So my entrie session uses the normal PHPSESSID cookie. I need that to last past the browser closing. How do i change the expiration of that cookie. Ive tried everything and i just get php errors or it doesnt set the cookie. Whats the right way to do it? Thanks. Link to comment https://forums.phpfreaks.com/topic/144134-cookies-and-sessions-oh-my/ Share on other sites More sharing options...
PFMaBiSmAd Posted February 6, 2009 Share Posted February 6, 2009 There are several ways to set the session cookie lifetime, but if you are expecting a session to persist for more than one browser session, you are probably storing something in a session that should actually be stored in a database. You must also extend the session garbage collection so that it does not delete the session data files on the server and on a shared server you must set the session.save_path to be to a private folder within your account's disk space so that your session data files are not deleted when other scripts run. Why do you need a session to last for more than one browser session? Link to comment https://forums.phpfreaks.com/topic/144134-cookies-and-sessions-oh-my/#findComment-756281 Share on other sites More sharing options...
optikalefx Posted February 7, 2009 Author Share Posted February 7, 2009 when you install a firefox extension the browser restarts. When that happens my extension pulls up a webpage that says thanks for downloading. Well that user had a session, and i want to subtract a counter from the database but i cant refer to that person unless i know who got to that page. I solved it by setting a cookie that way when i restart just read the cookie and then get the database info that way. Link to comment https://forums.phpfreaks.com/topic/144134-cookies-and-sessions-oh-my/#findComment-756637 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.