expresso100
Programmer
I need to "tie together the cookie with the domain" by referencing the information from my web.config below in my login's codebhind. I don't understand how. I need to also save that after doing so:
<add key="cookieDomainName" value=".test.com" />
<authentication mode="Forms">
<forms loginUrl="login.aspx" name="CH.COM.AUTH" path="/"/>
</authentication>
something like this:
HttpContext.Current.Application.GetKey(cookieDomainName);
then tie the cookie to the form name?
Here's the skeleton of our login.aspx.cs:
public partial class login : Web.BasePage
{
protected void Login1_LoggedIn(object sender, EventArgs e)
{
Login login = (Login)LoginView1.FindControl("Login1");
CMembershipUser user = (CMembershipUser)Membership.GetUser(login.UserName);
ProfileCommon profile = Profile.GetProfile(login.UserName);
profile.User.CUserID = user.CUserID.ToString();
profile.Save();
HttpContext.Current.Application.GetKey(cookieDomainName); <<---my attempt here to start relating the cookie to the domain...this is probably incorrect.
}
}
I'm completely lost. I know this is simple but I haven't done much with cookies in .NET 2.0. We are using the membership api in 2.0
<add key="cookieDomainName" value=".test.com" />
<authentication mode="Forms">
<forms loginUrl="login.aspx" name="CH.COM.AUTH" path="/"/>
</authentication>
something like this:
HttpContext.Current.Application.GetKey(cookieDomainName);
then tie the cookie to the form name?
Here's the skeleton of our login.aspx.cs:
public partial class login : Web.BasePage
{
protected void Login1_LoggedIn(object sender, EventArgs e)
{
Login login = (Login)LoginView1.FindControl("Login1");
CMembershipUser user = (CMembershipUser)Membership.GetUser(login.UserName);
ProfileCommon profile = Profile.GetProfile(login.UserName);
profile.User.CUserID = user.CUserID.ToString();
profile.Save();
HttpContext.Current.Application.GetKey(cookieDomainName); <<---my attempt here to start relating the cookie to the domain...this is probably incorrect.
}
}
I'm completely lost. I know this is simple but I haven't done much with cookies in .NET 2.0. We are using the membership api in 2.0