locked
how to restrict user to go back after logout? RRS feed

  • Question

  • User-1479058063 posted

    <p>Hi all, Can anyone tell me how to restrict user to go back after logout? ie: after logout, if user clicks back button then login page should appear rather than going to previous page...</p>

    Thanks

    Saturday, April 25, 2009 1:17 AM

Answers

All replies

  • User1564875471 posted

    Hi, 

    You need to stop the browser from caching your pages, place the following code in the Page_Load function of any page that you want to pevent the browse from caching it.

    Response.Cache.SetCacheability(HttpCacheability.NoCache);

    If you want to apply that for all of your pages, you can place that code in the Master page Page_Laod function or you can create a base class for your pages.

    Saturday, April 25, 2009 1:38 AM
  • User-501974848 posted

    Please check the following post:

    http://forums.asp.net/t/1369725.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, April 25, 2009 1:41 AM
  • User-1171043462 posted

    p>Hi all, Can anyone tell me how to restrict user to go back after logout? ie: after logout, if user clicks back button then login page should appear rather than going to previous page...</p>

    Thanks

    you can take help of javascript for that refer here

    http://www.aspsnippets.com/post/2009/03/24/Disable-Browser-Back-Button-Functionality-using-JavaScript.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, April 25, 2009 1:47 AM
  • User-1479058063 posted

     Thanks to u all. I solve the problem.

    Monday, April 27, 2009 10:15 AM