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.

Support force-logout for active sessions

See original GitHub issue

Right now you can only force-logout a remember-me token by using a custom token. It would be nice if there was a clean way to do this for active sessions, too.

From a quick look at the code this could probably be done by making get_id return e.g. a tuple of userid, token and the user_loader handling this token accordingly (retrieving the user from the DB and checking if the tokens match). However, the documentation is quite clear about the user id having to be unicode and a second look at the code shows that the user id actually converted to a string at some point: data = encode_cookie(str(session['user_id'])) (actually, shouldn’t this be unicode and not str?).

Sure, I could use a custom string representation such as id:token but it feels dirty.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Jul 4, 2016

I find this is needed, on my situation

  1. the user fresh login in current session
  2. the user reset the password in another session
  3. the user is still login in the current session

really need some way to force that user to reenter the password. cause they already reset there password.right?? and please support…

1reaction
philipithomascommented, Feb 19, 2016

We just implemented this on our end. It was pretty hacky with flask-login, requiring hijacking of the get_id function to incorporate both a user_id and session_id.

Some better separation of id and session_id in flask login would have been really helpful, and set me up to have a callback to validate the session id too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to force logout a specific user from all active sessions?
Choose the operator you want to log out of and click on the three dots corresponding to the operator's name. You will see...
Read more >
Log off all Remote Desktop Session Users - Windows Server
Under some conditions, an administrator may want to force a logoff of all users currently logged on to a Remote Desktop server.
Read more >
How do I force active users to log off? - LastPass Support
Select More actions > Destroy all sessions. Destroy all sessions in new Admin Console. Select Destroy sessions to confirm. Results: Your selected user(s) ......
Read more >
Is there a way to force active sessions to redirec... - ServiceNow
To comply with HITRUST requirements, any system that has sensitive information should force a logout when sessions expire.
Read more >
Sign a User out of all Office 365 Apps and Sessions
If you need to remove a users access to an account immediately, the steps below will force a sign-out on all devices signed...
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