Re: Forms Authentication: Storing UserData in the "FormsCookieName" Cookie
From: John Saunders (jws@jws.ultranet.com)
Date: 08/23/02
- Next message: Ion: "Impersonate and shared hosting"
- Previous message: Grant Holdom: "RE: HttpClientCertificate IsValid method"
- In reply to: John Saunders: "Forms Authentication: Storing UserData in the "FormsCookieName" Cookie"
- Next in thread: John Saunders: "Re: Forms Authentication: Storing UserData in the "FormsCookieName" Cookie"
- Reply: John Saunders: "Re: Forms Authentication: Storing UserData in the "FormsCookieName" Cookie"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "John Saunders" <jws@jws.ultranet.com> Date: Thu, 22 Aug 2002 22:51:26 -0400
Duh.
Since both FormsIdentity.Ticket and FormsIdentity.Ticket.UserData are
read-only, I guess I don't have to worry about the updated values being sent
in the cookie.
Ok, so, I missed that, but did I miss something else as well? I can create a
new FormsAuthenticationTicket, including my UserData, but is there a way to
substitute my ticket for the one that the FormsAuthenticationModule issues?
I tried removing his cookie and adding my own, but that just gave me two of
them.
The ticket issued by the FormsAuthenticationModule represents an
authenticated user. You could say it's a serialized FormsIdentity that the
FormsAuthenticationModule deserializes whenever it receives the cookie. I
should be able to add my own custom UserData to that ticket and to use it in
my AuthenticateRequest event to deserialize my own IPrincipal instead of
adding my own cookie, independant of the FormsAuthenticationModule and
perhaps behaving differently from the FormsAuthenticationModule cookie. For
instance, if one cookie expired before the other, it would be a bad thing.
"John Saunders" <jws@jws.ultranet.com> wrote in message
news:udS8xDfSCHA.1648@tkmsftngp09...
> I've seen several examples of code that creates a separate cookie in the
> AuthenticateRequest event in order to store user data such as a list of
> roles. Many of these examples even use a FormsAuthenticationTicket and
store
> the data in the UserData property of the new ticket.
>
> But is there a way to store such data in the UserData property of the
ticket
> that's actually used by Forms Authentication? If one sets ((FormsIdentity)
> User.Identity).Ticket.UserData, does the updated ticket get sent back to
the
> client's browser in an updated cookie? I haven't seen this documented
> anywhere.
>
> Thanks,
> John Saunders
> johnwsaundersiii@hotmail.com
>
>
>
- Next message: Ion: "Impersonate and shared hosting"
- Previous message: Grant Holdom: "RE: HttpClientCertificate IsValid method"
- In reply to: John Saunders: "Forms Authentication: Storing UserData in the "FormsCookieName" Cookie"
- Next in thread: John Saunders: "Re: Forms Authentication: Storing UserData in the "FormsCookieName" Cookie"
- Reply: John Saunders: "Re: Forms Authentication: Storing UserData in the "FormsCookieName" Cookie"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|