Jump to content

cookies and sessions oh my


optikalefx

Recommended Posts

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?

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.