ASP.NET forms authentication – created a ticket, but how does FormsAuthentication know about it?



I have seen several examples where a FormsAuthenticationTicket is
constructed and added to a manually created cookie. However, I can’t
connect the dots to see how FormsAuthentication “knows” about this
ticket that has been created? The only method that I can see might do
this is the SetAuthCookie, but the ticket isn’t passed as a parameter.

I need to create my own FormsAuthenticationTicket because I need it to
expire at the end of the day. The web.config setting only allows me
to specify a scalar minute value. I need it to expire at...

DateTime.Now.AddDays(1).Date;

Can someone shed some light for me please?

Thanks,
John
.



Relevant Pages

  • FormsAuthentication und schlaflose Nächte
    ... FormsAuthenticationTicket ticket = new FormsAuthenticationTicket( ... string sEncTicket = FormsAuthentication.Encrypt; ... Die Rolle im Ticket aufzubewahren scheint mir das Naheliegenste zu sein. ... Auf der Logon Seite finde ich ...
    (microsoft.public.de.german.entwickler.dotnet.asp)
  • Re: Forms Authentication in ASP.NET 2.0
    ... FormsAuthenticationTicket ticket = new FormsAuthenticationTicket( ... // Encrypt the cookie using the machine key for secure transport ... That's pretty much all you need for the Forms Authentication without using ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Use of Login Control
    ... Dim id As FormsIdentity = CType ... Dim ticket As FormsAuthenticationTicket = id.Ticket ... Dr. Doug Pruiett ...
    (microsoft.public.vsnet.general)
  • Re: Methods, Named Parameters
    ... > lingo) to be a useful way to document code. ... > ticket = new FormsAuthenticationTicket ... >>> Cheers, Pete ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Using forms authentication for the first time
    ... You should create the ticket by your self. ... HttpCookie cookie = FormsAuthentication.GetAuthCookie; ... // Store roles inside the Forms cookie. ... FormsAuthenticationTicket newticket = new FormsAuthenticationTicket( ...
    (microsoft.public.dotnet.framework.aspnet.security)

Quantcast