Saving user data using FormsAuthenication

  • Thread starter Thread starter MU
  • Start date Start date
M

MU

Hello,

I am using FormsAuthentication to log a user into the system. When
the user authenticates, I use FormsAuhentication.RedirectFromLoginPage
(txtEmailAddress.text, False). If I would like to reference the
user's First Name or UserID in the application on other pages, what is
the best way to save that data?

Right now, I'm using Session
Session("UserID") = userDataTable.Rows(0)("UserID").ToString()

Seems when I use Session, it resets when I visit the other pages and
the data is no longer in the Session object. Is there a better way?
Do I have to tell the application that I am using Session in
web.config?

Any suggestions are welcome.
Thanks
 
Since you are using Forms Auth, you are probably using the Membership bits
in ASP.NET. If so, you can have the user's name, etc., stored in Profile and
get it from there. I would create custom Profile objects, personally, as the
built in implementation is problematic. Very flexible, but problematic.

--
Gregory A. Beamer
MVP: MCP: +I, SE, SD, DBA

Blog:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think Outside the Box! |
********************************************
 
Back
Top