From the post I'm not sure if the sample code is being used inside of the Login control or not. I did try the following code in just a plain .aspx page used for login:
//Manual cookie issuance
FormsAuthenticationTicket authTicket = new FormsAuthenticationTicket(txtUserId.Text, false, 200); //hardcoded 200 minute duration
string encryptedTicket = FormsAuthentication.Encrypt(authTicket);
HttpCookie authCookie = new HttpCookie(FormsAuthentication.FormsCookieName, encryptedTicket);
HttpContext.Current.Response.Cookies.Add(authCookie);
Response.Redirect("default.aspx");
And then in default.aspx writing out the expiration time:
FormsAuthenticationTicket fat = FormsAuthentication.Decrypt(Request.Cookies[".ASPXAUTH"].Value);
Response.Write("fat.expires=" + fat.Expiration);
This is returning the correct expiration as set on the login page.
However, if you are attempting to set the cookie from inside of the Login control's Authenticate event, this event is too early to be setting the cookie manually. The login control event sequence looks like:
Raises the Authenticate event ---> Login control sets the cookie with a call to SetAuthCookie --> Raises the LoggedIn event
To manually control the cookie expiration and cookie issuance, put the cookie code in the LoggedIn event. I would recommend first removing the cookie set by the Login control (HttpContext.Current.Response.Cookies.Remove), and then re-issuing the cookie manually.
One other quick note: you should only set the cookie's expiration property if the user indicated they wanted a persistent cookie. The code shown in the post is always setting the HttpCookie's expiration date, which has the effect of always making the cookie persistent.