zibrnp Posted July 22, 2014 Share Posted July 22, 2014 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 More sharing options...
Larry Posted July 23, 2014 Share Posted July 23, 2014 I'd first confirm that you're looking at the right cookie. Perhaps start by trying it with a new cookie with a new name, just to confirm. Link to comment Share on other sites More sharing options...
zibrnp Posted July 23, 2014 Author Share Posted July 23, 2014 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 More sharing options...
Larry Posted July 27, 2014 Share Posted July 27, 2014 Okay. I would still start debugging this by trying it with a fresh, new cookie. Also, always good to test such things in different browsers to see if it's particular to one browser or not. Link to comment Share on other sites More sharing options...
Recommended Posts