开发者

My cookie expiration date does not get set on localhost

In my rails app I'm saving a session in a cookie;

cookies.permanent.signed[:remember_me] = [user.id]

Now I'm using the permanent method, but I've tried the other vari开发者_如何学Pythonations too, without success. The cookie always expires on browser close.

Yet if I deploy the app, all works well and the cookie receives the correct expiration date.

Im using ruby1.8.7 w/ rails 3 on winXP. Does not work in any browser on localhost.

What could be the problem here?


If you set a domain name on the cookie that doesn't match, it will be ignored.

Double check your domain, since most folks don't set it properly for localhost.

If that fails, open up Firebug or Chrome inspector and see exactly what cookie header is being returned on your request.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜