I have a case were I catch a js event and need to logout. So I tried to send a request via AJAX to .../index/logout the request gets there and but it isn't reseting auth here is my logout function def logout(): session.authorized = None session.auth = None session.forget() redirect(URL(r=request, f='index'))
this returns the login page to ajax request and I get the loging page in the request text. I couldn't figure out how to get this back to the browser so tried location.href = ' url to index' This in turn takes me to the index method in the controller, however the @auth.requires_login() doesnt think that auth is None and in fact it isn't. I found that if I add session.clear() to the logout function all works OK. Is there an explanation for this. If nothing else, maybe the session.clear() should be included in distro. thanks, max