1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to stop viewing secured pages after logout using asp.net(c#)

Discussion in 'C#' started by bloomsden, Jan 30, 2009.

  1. #1
    In my site iam using login sessions for secured pages, but after logout even though sessions are removed the pages are moving back when we press browser back button. for that i have disabled back button using javascript. but this is making me not to go even my login session is enabled. please help me how to stop going back only after logout.
     
    bloomsden, Jan 30, 2009 IP
  2. pitagora

    pitagora Peon

    Messages:
    247
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #2
    if the session no longer exist and your application correctly determines the user is not logged in, then what you probably see are cached pages. You can tell the browser not to cache any pages like this:

    Response.Cache.SetCacheability(HttpCacheability.NoCache);

    you can add it in your onload event. If you don't want to do this in every page, then make a basepage with this functionality and inherit all the other pages from it.
     
    pitagora, Jan 30, 2009 IP