Click here to Skip to main content
Sign Up to vote bad
good
protected void LinkButton3_Click(object sender, EventArgs e)
    {
        string connStr = ConfigurationManager.ConnectionStrings["MyConnection"].ConnectionString;
        SqlConnection con = new SqlConnection(connStr);
        con.Open();
        string dat =Convert.ToString( DateTime.Now.ToShortDateString());
        SqlCommand cmd = new SqlCommand("update LoginData set LogoutTime='" + dat+ "' where LogSession='" + sessionlog + "'", con);
        cmd.ExecuteNonQuery();
        con.Close();
        Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "Script", "alert(' You Are Now Logged Out....');", true);
        Response.Redirect("main.aspx");
     
     }
Posted 11 Feb '13 - 2:52
Edited 11 Feb '13 - 2:58
Raje_5.3K


2 solutions

I am assuming that if browser back button is clicked after LOGOUT is clicked, application is going back into the application without asking credentials. Take a look at following links, hope they help you:
Browser back button issue after logout[^]
Browser Back Button issue[^]
how to prevent back button after logout in asp.net[^]
  Permalink  
Comments
shoaib_ferrari - 11 Feb '13 - 9:47
Thanks Vani...but i tried all the methods but still not able to solve the issue
It doesn't look like you are clearing the authentication cookie.
  Permalink  
Comments
shoaib_ferrari - 11 Feb '13 - 11:06
How do you clear that?? I am new to programming...any help pls
Matthew Dennis - 11 Feb '13 - 11:09
try searching for ASP.NET Membership http://www.codeproject.com/search.aspx?q=asp.net+membership&sbo=kw&x=0&y=0

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 375
1 Sergey Alexandrovich Kryukov 173
2 Abhinav S 168
3 Guirec Le Bars 120
4 Ron Beyer 100
0 Sergey Alexandrovich Kryukov 8,439
1 OriginalGriff 6,681
2 CPallini 3,553
3 Rohan Leuva 2,793
4 Maciej Los 2,234


Advertise | Privacy | Mobile
Web03 | 2.6.130516.1 | Last Updated 11 Feb 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid