question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

every session becomes a remember session when REMEMBER_COOKIE_REFRESH_EACH_REQUEST is set

See original GitHub issue

Describe the bug A user is logged in with remember=False. If the app is configured with REMEMBER_COOKIE_REFRESH_EACH_REQUEST, the remember cookie gets set anyway.

To Reproduce Steps to reproduce the behavior:

  1. Add REMEMBER_COOKIE_REFRESH_EACH_REQUEST = True to the flask configuration.
  2. Call login_user(..., remember=False)
  3. Verify that the remember cookie was set anyway.

Expected behavior The remember cookie should not be set if the user was logged in with remember=False

Additional context

This seems to be the culprit:

https://github.com/maxcountryman/flask-login/blob/486c456907e307e363d0c334fb2c079d4fa25d55/flask_login/login_manager.py#L422-L424

The code below that calls _set_cookie which sets the remember cookie.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
RazerMcommented, Jun 5, 2019

@maxcountryman I can submit a PR if you agree with the expected behaviour I wrote above

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to restore closed tabs and sessions in your web browser
Hold down the [Ctrl] key and click all the tabs you wish to restore. You can also set up Chrome to auto-restore your...
Read more >
Firefox Restore Session Display window - Mozilla Connect
I like to keep a huge number of windows and tabs and restore my last session every time I restart. When that happens...
Read more >
Chromium Docs - Session History
A browser's session history keeps track of the navigations in each tab, to support back/forward navigations and session restore.
Read more >
Session is lost and created as new in every servlet request
Clearing this single cookie or all cookies is a workaround. I was debugging the problem with wget, and I noticed such a header:...
Read more >
Saved Sessions | Vivaldi Browser Help
This allows you to open the set of tabs included in a session with one click whenever you need or when the browser...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found