How to disable the back button in browser when user logout in asp.net c#

前端 未结 7 1983
名媛妹妹
名媛妹妹 2020-12-06 02:31

Our problem is we are able to clear session on logout.

But if a user clicks the back button then he/she can go through all previous screens.

But the advantag

7条回答
  •  生来不讨喜
    2020-12-06 03:09

    write this code in master page in page load event

    Response.Cache.SetCacheability(HttpCacheability.NoCache);
    Response.Cache.SetExpires(DateTime.UtcNow.AddHours(-1));
    Response.Cache.SetNoStore();
    

    and write this code in Login page in head section

     
    

提交回复
热议问题