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?

Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.