Ask A Question

Notifications

You’re not receiving notifications from this thread.

User logoff/clear session

Dainius asked in General

Hello, folks,
rails developer with week experience here :) I tried to make user sign up/log on/log off functionality from scratch, but after clicking on logoff link the session remains active because of browser cookies. My log off realization is in this gitlab snippet: https://gitlab.com/snippets/1987967
Did I missed something? Thanks a lot.

Reply

Hey Dainius,

That looks like it would work fine to me. What's happening? You're still logged in after it redirects you?

You're going to want to change that to a DELETE request though, otherwise people can do semi-malicious things and log you out from any website just by making your browser load that URL.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 82,329+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.