how do i display session id on the web

50 pts.
Tags:
ASP.NET
C
MySQL
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.

Answer Wiki

Thanks. We'll let you know when a new response is added.

<a href=”http://www.csharphelp.com/archives/archive185.html”>Here</a> is a good article on the sesion object. This is likely the object you are going to want to call from within your code to display the session ID.

You likely will need to wrap some code (and possibly database tables or rows) around linking the session ID’s to the login and authentication you put in place for your site.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • JDantin
    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
    350 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following