All threads / User logoff/clear session
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.

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.

Join the discussion

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

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

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

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2022 GoRails, LLC. All rights reserved.