Skip to content

reset_session when logging out changes csrf_token #480

Open
@hgani

Description

@hgani

I noticed that logging out destroys the whole session (including csrf token) and causes a new token to be regenerated. See: https://github.com/NoamB/sorcery/blob/master/lib/sorcery/controller.rb#L60

This causes a problem when a user has two tabs open. In the first tab, the user views a form. In the second tab, the user logs out (which essentially changes the currently active token).

When the user goes back to the first tab and submits the form, it will fail because the page still uses the old token.

My questions:

  1. Is this behaviour intentional or is this a bug?
  2. If it is, what should my web app do? Because as it is, the failure will really confuse the user.

By the way, this issue is similar to #250

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions