Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

asp:LoginStatus automatically log out after some time

$
0
0

hi

I have asp:LoginStatus on my master page

and in my login.aspx.cs file I have logiIn button, which have the selected event handler

protected void btLogIn_Click(object sender, EventArgs e)
        {
            int chk = _dbobj.CheckingIfUserExists(tbUserName_login.Text, tbPassword_login.Text);
            if (chk != 0)
            {
                Response.Cookies["UserName"].Value = tbUserName_login.Text.Trim();
                lbUserNameValidation_logIn.Text = "";
                Response.Redirect("Home.aspx", false);

                if (chbRemember_login.Checked)
                {
                    Response.Cookies["UserName"].Expires = DateTime.Now.AddDays(1);
                    System.Web.Security.FormsAuthentication.RedirectFromLoginPage(tbUserName_login.Text, true);
                }
                else
                {
                    Response.Cookies["UserName"].Expires = DateTime.Now.AddDays(-1);
                    System.Web.Security.FormsAuthentication.RedirectFromLoginPage(tbUserName_login.Text, false);
                }

            }
            else
               ............

When I log in without checking remember box, it remembers anyway, and doesn't set logged out after closing and opening the page.

What to do. Please help


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>