Jump to content

Never Expiring Cookie


mike177

Recommended Posts

Hi, I need a little help with cookies. I want m cookies on my site to never expire unless the browser is closed or the user logout. On the php site it says to set the expire to 0. I tried this and the cookie expired a few seconds later.

 

Does any one have some suggestions.

 

Thanks in advance for any help.

Link to comment
Share on other sites

You are asking for two different things.  You say never to expire unless the browser is closed.  Setting it to 0 or no time means it will expire when the browser closes.  So do you want it to "never" expire (which is not possible) or do you want it to expire when the browser is closed?

 

Hi, I need a little help with cookies. I want m cookies on my site to never expire unless the browser is closed or the user logout. On the php site it says to set the expire to 0. I tried this and the cookie expired a few seconds later.

 

Does any one have some suggestions.

 

Thanks in advance for any help.

Link to comment
Share on other sites

You are asking for two different things.  You say never to expire unless the browser is closed.  Setting it to 0 or no time means it will expire when the browser closes.  So do you want it to "never" expire (which is not possible) or do you want it to expire when the browser is closed?

 

Hi, I need a little help with cookies. I want m cookies on my site to never expire unless the browser is closed or the user logout. On the php site it says to set the expire to 0. I tried this and the cookie expired a few seconds later.

 

Does any one have some suggestions.

 

Thanks in advance for any help.

Yea I just want the cookie to expire either when the user clicks the logout link to execute the logout script or when the user closes the browser. So I want the cookie to last as long as the user is logged in.

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.