You can easily add custom data to an auth cookie by using the following:
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(
false, // not persistent
userData, // <-- THIS CAN BE A STRING OF YOUR CUSTOM DATA, PERHAPS
Note: the 'userdata' variable which is of type string.
- Paul Glavich
"Justin Morris via DotNetMonster.com" <forumnospam.DotNetMonster.com> wrote
in message news:a6cbd5f34654423a9537afe03f335fa1DotNetMonste r.com...have> When implementing ASP.NET forms authentication everything worked out just
> fine. I wanted to add the UserID and UserFName to my usage so I wouldSession(?UserID?)> this information throughout their session without having to return to the
> database. I am upgrading from ASP so my first thought isSession> which works fine if the user stays in the same folder (members). But if
> they click a link outside that folder and return to that folder thegone.> values I had set are now gone.
> I use the return path code so when they click the login link it takes them
> to the default.aspx login page without logging in again. Like I said
> earlier, when they login the Session values work, and if they click links
> in the same folder (members) the Session values work, but if they go to
> another folder and return to the members folder the Session values are>
> Should I not use Session(?Value?)? How can I add other values to the
> FormsAuth Ticket we created and use in my pages to display User Name?
> Message posted via [url]http://www.dotnetmonster.com[/url]