SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru coiL's Avatar
    Join Date
    Sep 2001
    Location
    QLD, Australia
    Posts
    666
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    help with registrering session variable

    Hi,

    I have a login script that registers the username in the session. I was wondering if it is more secure to register both the username and the password? and if so how do I add that in?

    The code I am using is:
    PHP Code:
    $_SESSION['valid_user'] = $result->username
    Thanks
    coiL
    "cradled in the learning curve"

  2. #2
    SitePoint Zealot
    Join Date
    Oct 2001
    Location
    London, UK.
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I personally wouldn't use the password within a session. Just use it to check that database for the correct login info.
    However, if you wanted to add another session variable with the password in, its a matter of doing the following:

    PHP Code:
    $_SESSION['valid_password'] = $result->password
    Simple really

    David
    Do you fear the obselescence of the
    metanarrative apparatus of legitimation?


Bookmarks

Posting Permissions

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