|
Hi! How to end session after logging out? I am facing a problem that when clicking on logout session ends. After clicking on back button, previous page repeats again. This happens in all the pages of my project.
Here is the code for logout link..
protected void linklogout_Click(object sender, EventArgs e)
{
if (linklogout.Text == "Log Out")
{
Session["username"] = null;
Session["userid"] = null;
Session.Abandon();
Response.Redirect("~/index.aspx");
}
}
Can any one help me?
|
|
|
|
|
I would have a read of this
how do you programatically end a session in asp net[^]
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
<script language="JavaScript">
javascript:window.history.forward(-1);
</script>
this is how i ends in asp.net
|
|
|
|
|
You are successfully killing the session there, so the previous page should no longer be active. (That is, nothing on it should work, because there will be no valid session for any action, and F5ing it should result in a failed authorisation and a return to the login page.)
What you need to do if you don't want browsers to show the page is make all your secure pages uncacheable. To do this in all browsers I think you need to set Pragma: no-cache, Cache-Control: none and also Expires: to a date in the past.
|
|
|
|
|
Hey this problem is solved as I use:
<META Http-Equiv="Cache-Control" Content="no-cache">
<META Http-Equiv="Pragma" Content="no-cache">
<META Http-Equiv="Expires" Content="0">
But today another problem came..
I have two links in my home page namely Register & Login. They are kept in a panel control and when I press enter from login popup it should be login. Till now every thing works.
When clicking on them(links) individually two modalpopups shown. When I press esc button they should be closed. But it is not working in a panel if I give BehaviorID to popup. Can any one help me?
Here is the asp.net code....
<script type="text/javascript">
//closes the popup by pressing the esc button on the keyboard
document.onkeyup = Escape;
function Escape()
{
var KeyID = event.keyCode;
if (KeyID == 27)
{
if ($find("MPEregisterescclose"))
{
$find("MPEregisterescclose").hide();
}
else if ($find("MPEloginescclose"))
{
$find("MPEloginescclose").hide();
}
}
}
</script>
|
|
|
|