Monday, March 28, 2011

What's the correct way to log a user out of a Rails application?

I'd like to provide a "log out" function in a Rails app. Should I do...

session.delete

or

reset_session

From reading the docs, both look like they could work. Does it matter? Or should I use something else?

From stackoverflow
  • I'd use reset_session, because it's part of the Rails API; whereas CGI::Session#delete is effectively an implementation detail which might change.

0 comments:

Post a Comment