Results 1 to 4 of 4

Thread: store user loginname and password

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2006
    Posts
    274

    store user loginname and password

    When user login with a username and password, how to store the username and password so that when the user is redirected to another page, the username and password can be used as the key reference to load the relevant info from database?

  2. #2
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Re: store user loginname and password

    Sounds like you would like to use Session variables.

  3. #3
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: store user loginname and password

    First off, make sure the password is hashed. You shouldn't be able to get it manually from the database or decrypt it.

    Secondly, once a user logs in you would typically set a session variable with the username and/or id in it. From there subsequent pages would take that session variable and correlate data from the database.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: store user loginname and password

    Don't store the password in a session variable for 'reauthenticating' everytime he accesses a new page. Once the user is authenticated, all you need is a token of some sort as illustrated in post #3. Having that token is proof that the user is logged in.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width