Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Can u get me code for logout form in html so thst by pressing back arrow no one could see my account.
Posted
Comments
_Amy 14-Jun-13 0:25am    
Did you Google[^] it?
Rosdyana Kusuma 14-Jun-13 0:46am    
do you mean back arrow in browser ? you must using session in your login logic

Lots of people ask this and the answer is always the same. If you log people out, then the back button will only show logged in content if you allow your pages to be cached by the browser. PHP has NOTHING to do with it.

http://www.htmlgoodies.com/beyond/reference/article.php/3472881/So-You-Dont-Want-To-Cache-Huh.htm[^]
 
Share this answer
 
C#
public partial class logout : System.Web.UI.Page
    {
        protected System.Web.UI.WebControls.Literal Literal1;
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                Literal1.Text = "<pre lang="c#">
;Logging out…";
Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();
}
catch { }
}


protected void Timer1_Tick(object sender, EventArgs e)
{
try
{
FormsAuthentication.SignOut();
Response.Redirect("helpdesk.aspx");
}
catch { }
}
}
 
Share this answer
 
v2
C#
protected void btnLogout_Click(object sender, EventArgs e)
       {

Session.Abandon();
Session.Clear();

Response.Redirect("main.aspx");
}
 
Share this answer
 
v2
Comments
[no name] 14-Jun-13 2:31am    
disable browser back button via javascript
Nirav Prabtani 14-Jun-13 2:35am    
<!-- Script by hscripts.com -->

<body onload="noBack();" onpageshow="if (event.persisted) noBack();" önunload="">

Click Here


<p>When ever you have to be click HIOX,the back button will be disabled.
</p>

</body>
<div style="font-size: 10px;color: #dadada;" id="dumdiv" align=center>
©h</div>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900