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????

Recommended Answers

All 13 Replies

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.
Session.Abandon();

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???

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

<script>
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 {
    history.forward();
  } 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);
}
</script>
</head>
<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??

hi i tried by using above code with an example its working fine forme...

hi try to place the above code in welcome page and logoutpage once

If your problem has solved please mark it as solved..
bye

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???

ok thx alot again

hello

i try to use it but it dos'n fix then what can i do[ /QUOTE]

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

hi saj, mark it solved so that next user can easily refer....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.