You set this value in the constructor for the
FormsAuthenticationTicket as shown below. After your user
is authenticated, try something like the following:
FormsAuthenticationTicket tkt;
string CookieStr;
HttpCookie ck;
// Create new Auth Ticket. Last argument authentication
timeout expressed in seconds.
SessionTimeout = 30; //Timeout in minutes
tkt = new FormsAuthenticationTicket(txtUserName.Text,
false, SessionTimeout * 60);
// Encrypt ticket
CookieStr = FormsAuthentication.Encrypt(tkt);
// Create the cookie
ck = new HttpCookie(FormsAuthentication.FormsCookieName,
CookieStr);
//Add cookie to HTTP header
Response.Cookies.Add(ck);
// Redirect to the main page
Response.Redirect("Default.htm", true);
HTH.
J. Ptak