C
craigkenisston
Hi,
I create a one day ticket in my authentication code like this :
private void btnLogin_Click(object sender, System.EventArgs e)
{
string _userId = txtUserId.Text;
string _password = txtPassword.Text;
if (FormsAuthentication.Authenticate(_userId,_password))
{
FormsAuthentication.RedirectFromLoginPage(_userId,false);
FormsAuthenticationTicket authTkt = new FormsAuthenticationTicket(1,
"mycookie", DateTime.Now, DateTime.Now.AddDays(1), true, _userId);
HttpCookie authCookie = new
HttpCookie(FormsAuthentication.FormsCookieName);
authCookie.Value = FormsAuthentication.Encrypt(authTkt);
authCookie.Expires = DateTime.Now.AddDays(1);
Response.Cookies.Add(authCookie);
}
}
Recently I added some subdomains to my site and I realize that the
authorization is not valid there, i.e. the user appears as not logged
in.
How can I make an authorization ticket valid for all the domain and its
subdomains ?
I create a one day ticket in my authentication code like this :
private void btnLogin_Click(object sender, System.EventArgs e)
{
string _userId = txtUserId.Text;
string _password = txtPassword.Text;
if (FormsAuthentication.Authenticate(_userId,_password))
{
FormsAuthentication.RedirectFromLoginPage(_userId,false);
FormsAuthenticationTicket authTkt = new FormsAuthenticationTicket(1,
"mycookie", DateTime.Now, DateTime.Now.AddDays(1), true, _userId);
HttpCookie authCookie = new
HttpCookie(FormsAuthentication.FormsCookieName);
authCookie.Value = FormsAuthentication.Encrypt(authTkt);
authCookie.Expires = DateTime.Now.AddDays(1);
Response.Cookies.Add(authCookie);
}
}
Recently I added some subdomains to my site and I realize that the
authorization is not valid there, i.e. the user appears as not logged
in.
How can I make an authorization ticket valid for all the domain and its
subdomains ?