K
Keith
I have a simple app that uses "simple" forms auth and works quite
nicely. Now all I want to add is the ability to store a handful of
custom data in the auth ticket and am very confused about how to do so.
I tried sticking it in a session variable (I come from old asp) but of
course the session and tickets don't expire at the same time...argh.
I am authenticating the user against my a mySQL database using:
---
FormsAuthentication.SetAuthCookie(txtUserName.Text, True)
and
FormsAuthentication.SignOut()
---
It works great, but the docs I have read talk about using global.asax
and the prinicpal and encrypt/decrypting cookies and my head starts to
get fuzzy.
Can someone supply some sample code to store (and then retrieve) some
custom data from the auth ticket?
nicely. Now all I want to add is the ability to store a handful of
custom data in the auth ticket and am very confused about how to do so.
I tried sticking it in a session variable (I come from old asp) but of
course the session and tickets don't expire at the same time...argh.
I am authenticating the user against my a mySQL database using:
---
FormsAuthentication.SetAuthCookie(txtUserName.Text, True)
and
FormsAuthentication.SignOut()
---
It works great, but the docs I have read talk about using global.asax
and the prinicpal and encrypt/decrypting cookies and my head starts to
get fuzzy.
Can someone supply some sample code to store (and then retrieve) some
custom data from the auth ticket?