Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 3:52am
Edited 11-Feb-13 3:58am
Raje_7.4K
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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 at 11-Feb-13 9:47am
   
Thanks Vani...but i tried all the methods but still not able to solve the issue
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

It doesn't look like you are clearing the authentication cookie.
  Permalink  
Comments
shoaib_ferrari at 11-Feb-13 11:06am
   
How do you clear that?? I am new to programming...any help pls
Matthew Dennis at 11-Feb-13 11:09am
   
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
0 DamithSL 375
1 Sergey Alexandrovich Kryukov 217
2 OriginalGriff 210
3 Peter Leow 135
4 Uma Shankar Patel 80
0 OriginalGriff 7,380
1 DamithSL 5,359
2 Sergey Alexandrovich Kryukov 4,944
3 Maciej Los 4,906
4 Kornfeld Eliyahu Peter 4,514


Advertise | Privacy | Mobile
Web01 | 2.8.141223.1 | Last Updated 11 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100