Jump to content
Larry Ullman's Book Forums

Recommended Posts

Hello,

I have been working on script 12.5. which allows to set cookie's parameters.

As the example in the book shows, I wanted to set cookie that expires within 1h from creation.
 

setcookie('user_id', $data['user_id'], time() + 3600, '/', '', 0, 0);

When checking the cookie after successful signing-in, Expires: always says Session.

Why is that?

 

Thank

Link to comment
Share on other sites

I am 100% sure I am looking at the correct cookie.
No matter how I set expiration parameter it always says "Session".
If I set expiration to time()+60 it actually expires after 60 seconds and I am not able to see restricted content.
So it works but I do not see this value when I view cookie.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...
 Share

×
×
  • Create New...