0

I have a question, probably very session related. What if we log on to user1 and someone from another computer logs on to the same user1, can you set it by some global variable to immediately log out what was previously logged in to it? I've seen the Django User Sessions library, but won't use it.

Hide856
  • 35
  • 6
  • Complicated. How would you identify the other computer? By IP? Then the user would get log out when his device changes from mobile to WiFi. You could do something client token related that is stored in the browsers local storage. What do you actually want to archive with this limitation? – Klaus D. Apr 04 '22 at 12:04
  • Each user performs some operations on the page. And this information goes to the report of what the user was doing. However, two people have the same user. And simply, if one of these people logs in, the one previously logged in must be automatically logged out. – Hide856 Apr 04 '22 at 12:15
  • So, what should happen if one user logs in from two devices, compared to two persons logging in with the same user? Are you going to annoy the one user by logging him out? Or do you want to find a way to identify the people using the devices? Creating these concepts is too broad for Stack Overflow. You will have to come up with it and then you can ask specific questions if you have troubles implementing it. – Klaus D. Apr 04 '22 at 12:33
  • It's just about logging out a specific user from any device. If some other person logs in to the same account, from what you say, it still has to be a token? I understand Django does not have such functions? At least I haven't found it. – Hide856 Apr 04 '22 at 13:00

0 Answers0