views:

138

answers:

1

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?

+6  A: 

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.

floehopper