I have the following requirement in a webapp2 application. When a user leaves his machine or browser, that user's previous authentication session should be terminated.
I am able to do this when a user logs in from a different machine, by storing the remote_addr in the User object at login. When the user's session is requested I check the remote_addr from the request against the user's remote_addr at login.
I am not happy with this solution, as it will not work when the user is behind a proxy server and also, it will not work when the user uses different browsers.
Does webapp2 store a session id somewhere, so I can use that to see if the user has logged on in a new session?