I can not understand why:
cookies.permanent[:aaa] = 'bbb'
Create cookie with key = ‘aaa’ and value = ‘bbb’ but Expires period = ‘Session’ ???
I wanna have 20 years.
Help me, please.
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It may be something on the client end.
You can try
And see if it does anything different.
On the other hand, this may be the wrong approach. Cookies are not guaranteed to last, because the user can change/delete them at any time. Worse, if the user fires up a different browser or uses a different machine, the cookie will not exist.
Maybe you can add whatever value you want to save to the user’s record and then reference it every time she logs into your system.