Using user names and passwords in a web app

Posted on 2006-05-26
Last Modified: 2010-04-24
I am working on a web-based help desk ticketing system (code is in VB.NET, but it's an ASP.NET 1.1 page), and I would like to use user names and passwords to not only control access to the application, but to also restrict some users from certain parts of the app.  I understand the concept of a user inputting his/her credentials and looking them up in the database to see if the credentials are valid.  However, I do not know how to keep this user information stored throughout the individuals web session.  For example, when the person creates a new ticket, I would like the ticket information to prepopulate itself with the user's basic info (once again, I know how to query the DB for this, but not sure how to keep track of the user).  Are there any good references or tutorials that I could read, or maybe suggestions you have, to accomplish this task?  BTW, the DB is a SQL2000 server, if that helps, and I'm using Visual Studio .NET 2003 to write the app.  Thanks in advance for your help.
Question by:christopher_perry
    1 Comment
    LVL 1

    Accepted Solution


    Why don't you use the session variable to store the user name. Whenever you want the user name you can access the username from the session variable.

    You can put any value into the secession using the follwing method :-

    Session("UserName") = sUserName

    You will use the above method after you authenticate the user.

    And you can retrive the data by

    sUserName = CType(Session("UserName"), String)

    you will use the above cod whenever you want to access the stored username.

    Hope this is helpful

    Thanks & Regards

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
    The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now