views:

219

answers:

1

I have a rails application which uses the restful_authentication plugin. I have activated the "remember me" functionality but every now and then I am getting logged out. The problem is I can't see the pattern for when it happens.

Sometimes it works in the development environment but not in production. Sometimes it works in Firefox but not in Safari.

Has anyone had similar problems? Also advice on how to test this in a reasonable way would be appreciated (without closing down and reopen the browser all the time).

+2  A: 

Are you logging in with multiple PCs/browsers?

The last time I used restful_authentication (which was a while ago) it used a column in your users table to store a remember me token. Logging in with "Remember me" checked on another browser would overwrite the token, effectively invalidating its usage in your first browser.

It's a bit more complicated to set up, but I highly recommend trying out AuthLogic instead.

natacado
The problem occurs on the same computer and the same browser. I will have look at AuthLogic!
magnushjelm