protected void LoginButton_Click(object sender, EventArgs e)
{
username = Guid.NewGuid().ToString();
Response.Write(username);
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(username, true, 20);
string cookiestr = FormsAuthentication.Encrypt(ticket);
HttpCookie ck = new HttpCookie(FormsAuthentication.FormsCookieName, cookiestr);
if (true)
{
ck.Path = FormsAuthentication.FormsCookiePath;
}
Response.Cookies.Add(ck);
FormsAuthentication.RedirectFromLoginPage(username, false);
}
protected void LogoutButton_Click(object sender, EventArgs e)
{
FormsAuthentication.SignOut();
Response.Redirect("Default.aspx");
}
{
username = Guid.NewGuid().ToString();
Response.Write(username);
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(username, true, 20);
string cookiestr = FormsAuthentication.Encrypt(ticket);
HttpCookie ck = new HttpCookie(FormsAuthentication.FormsCookieName, cookiestr);
if (true)
{
ck.Path = FormsAuthentication.FormsCookiePath;
}
Response.Cookies.Add(ck);
FormsAuthentication.RedirectFromLoginPage(username, false);
}
protected void LogoutButton_Click(object sender, EventArgs e)
{
FormsAuthentication.SignOut();
Response.Redirect("Default.aspx");
}