hi developers
my name is sajjad i have little problem in asp.net i have made two pages one is login and other is welcome page a user enters name and password in login page after checking valid user it open welcome page and after signout jumps to login page again nw problem is that when i hit sign out button it comes on sign in page to get username and pass again but without doing it if i am pressing back button on the top of the browser it displays welcome page with same user which last entered. how can i stop this plz help me out????

8 Years
Discussion Span
Last Post by kameswari

hi sajjad,
Here you need to use session concept. When ever a newuser is logged into the site from the login page ->it will automatically sets a session to that user (if the user is valid) then it will redirected to welcomepage. During the signout u need to kill that session which u have created to that user.

To kill the session use the following method.


thx kameswari
but you are not getting my point i have created sessions to get data and i have also use that code ti kill session Session.Abandon() but after comming back to login page when i am hitting back button it even again load same page???


IN ur code please use the following javascript in source code of the loginpage.

function backButtonOverride()
  // Work around a Safari bug
  // that sometimes produces a blank page
  setTimeout("backButtonOverrideBody()", 1);


function backButtonOverrideBody()
  // Works if we backed up to get here
  try {
  } catch (e) {
    // OK to ignore
  // Every quarter-second, try again. The only
  // guaranteed method for Opera, Firefox,
  // and Safari, which don't always call
  // onLoad but *do* resume any timers when
  // returning to a page
  setTimeout("backButtonOverrideBody()", 500);
<body onLoad="backButtonOverride()">

tell me whether ur pbm is solved or not by placing above code//


i am using asp.net so is this code supports and sorry to distrub but i am new in asp.net switching from vb.net so because of that i am facing these problems and i have placed that code in login form in source but its not working??


o wow thx realy alot when i place that code in both pages then it works very fine but still one problem for a second it shows welcome page and then it jumps again and works fine what i do for that can i set time out amount little less???


dear sanotsami i place that code in both of the pages after the head tag and before body tag its working fine

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.