hi,
I am doing a login page with mysql and asp.net/c#. I would like the program to run in the following sequence.
1. the user login
2. the login page will search through mysql database,
3. when it is Authenticate, it will allow the user to access.
my concern now is how to you use the session id to display the username when it is login.
Software/Hardware used:
ASKED:
February 26, 2008 9:38 AM
UPDATED:
March 10, 2008 8:08 PM
A little bit more details to follow the previous answer…
After authenticating your user, set up his user name in Session:
Session[“UserName”> = myUserName;
where myUserName is the value you got for your user name from your authentication process / DB.
To display it in other pages, just pull your UserName variable from the Session:
String myUserName = (String) Session[“UserName”>;
You need to put this in a try / catch block too. If your session times out, you won’t be able to pull this value and need to take care of the exception.
Hope this helps!
Joelle