My company has a web application hosted on a client\'s machine that uses forms authentication in ASP.net. When visiting the website http://www.client.com/Application and tr
Use this way:
int timeoutValue = 20; // This value is actually returned from a method;
FormsAuthenticationTicket authTicket = new FormsAuthenticationTicket(txtLogin.Text, false, timeoutValue);
string encryptedTicket = FormsAuthentication.Encrypt(authTicket);
HttpCookie authCookie = new HttpCookie(FormsAuthentication.FormsCookieName, encryptedTicket);
authCookie.Domain = "uptime.com.br";
authCookie.Expires = DateTime.Now.AddMinutes(timeoutValue);
HttpContext.Current.Response.Cookies.Add(authCookie);