Try setting it this way: I've set the cookie to timeout after 20 minutes
but you can change this
FormsAuthenticationTicket authTicket = new
FormsAuthenticationTicket(tbUserName.Text, false, 20);
// Encrypt and store the ticket
string encryptTicket = FormsAuthentication.Encrypt(authTicket);
HttpCookie authCookie = new HttpCookie(FormsAuthentication.FormsCookieName,
encryptTicket);
authCookie.Domain = ConfigurationSettings.AppSettings["domain"];
// Redirect
Response.Cookies.Add(authCookie);
Response.Redirect(FormsAuthentication.GetRedirectU rl(tbUserName.Text,
false));
"Grant Merwitz" <gr***@workshare.com> wrote in message
news:OC**************@TK2MSFTNGP10.phx.gbl...
how do you set the domain of a FormsAuthentication Cookie?
Currently the only method i'm calling is:
FormsAuthentication.RedirectFromLoginPage(tbUserNa me.Text, false);
I can't find any FormsAuthentication.Domain or anything like that
The only other thing i can see is an overload for 'RedirectFromLoginPage':
public static void RedirectFromLoginPage(
string userName,
bool createPersistentCookie,
string strCookiePath
);
I've attached my control files
"Janaka" <ja*****@hotmail.com> wrote in message
news:uv**************@TK2MSFTNGP15.phx.gbl... Grant,
Is this a local app you are debugging or on the live server? Try setting
the domain property of the cookie. That may clear up the double cookie
problem.
Janaka
"Grant Merwitz" <gr***@workshare.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl... Hi, i am using forms authentication in an ASP.NET project
I am setting the Forms authentication cookie by using:
FormsAuthentication.RedirectFromLoginPage(UserName .Text, false);
Now when i review my trace on my page, there are two cookies created
that
look identical.
When i FormsAuthentication.SignOut() they both dissappear.
Any ideas as to why two cookies are created?
TIA