Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jun 2003
    Posts
    82
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Login/Logout one more time

    The only problem I have is how to prevent a user to go back on the browser's back button click after being logged out.

    1. The following method is fine since the Back Button doesn't work -
    <input onClick="window.location.replace('login.asp')" type=button value="Log Out">

    2. But <a href="login.asp">Log Out</a> doesn't work properly unless I add Response.Cache.SetCacheability(HTTPCacheability, NoCache) in the Page Load event.

    Would anybody tell me what is the difference between href and window.location.replace and why do they work differently?
    Also which method is preferred?

    Thanks

  • #2
    Regular Coder Crake's Avatar
    Join Date
    Dec 2004
    Location
    Loose, Maidstone, KENT
    Posts
    577
    Thanks
    0
    Thanked 3 Times in 3 Posts

    they dont work differently i dont think

    ive always thought they worked togeva

  • #3
    New Coder
    Join Date
    Jun 2003
    Posts
    82
    Thanks
    0
    Thanked 0 Times in 0 Posts
    maybe they don't but the browser's back button does...

  • #4
    Regular Coder
    Join Date
    Jul 2004
    Location
    France
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts
    it doesn't matter at the first click somewhere he will be kicked out

    you cannot unallow esb01 someone to print the page :-)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •