1

After log out from my app, I have redirected the user to the log in page. At the log in page, when someone click back or next buttons of the browser, I want to redirect him to the login page as same as gmail or facebook.

So I tried to clear cache as follow,

class LogoutHandler(SecurePageHandler):
def get(self):
    self.session_store.delete_cookie('session')
    self.session.clear()

    response = self.redirect('/')
    response.headers['Cache-Control'] = 'no-cache, no-store, max-age=0, must-revalidate'
    response.headers['Pragma'] = 'no-cache'
    response.headers['Expires'] = 'Fri, 01 Jan 1990 00:00:00 GMT'
    return response   

But still the back button directing me to the previous page which I logged out from.

I noted that, Referer field in the Request Headers still keeping the previous URL. So I think, I should have to override it. But I couldn't find a way to modify my Request object.

I am trying on this more than half a day and I sincerely appreciate if someone can help me.

Thanx

jcollado
  • 39,419
  • 8
  • 102
  • 133
chinthakad
  • 939
  • 2
  • 16
  • 31

1 Answers1

0

Maybe you can try to use javascript's window.location.replace after logout so that the page you don't want to go back to is replace with the new login page.

jcollado
  • 39,419
  • 8
  • 102
  • 133
  • Thanx jcollado. I could see it's not working on IE. I tested following tutorial. http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_loc_replace – chinthakad Dec 13 '11 at 09:03