SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Nov 2000
    Location
    London, UK
    Posts
    223
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi there,

    Ok, I'm sure that this has been talked about a lot before, but basically I'm wondering this: what's an easy way to maintain state w/out cookies. For example, this message board: even if you have cookies not enable in your browser, once you login, it remembers you. I'm assuming it's because of that s=... thingy in the querystring (s probably standing for session), but I'm not exactly sure how they do that.

    I mean, would you store the user's ID and other info in a database with a hashed user ID for the row's ID like this:
    ID | Username | Password | sessionID
    $userID | $username | md5($password) | md5($userID)

    Or what else could you do?

    Thanks for suggests!

    ... what's the world coming to?

  2. #2
    SitePoint Zealot
    Join Date
    Jun 2000
    Posts
    165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As an overview, here's 1 decent approach:


    - create a unique id for each user (e.g. use md5())

    - create a field in the table that will contain these unique id's (as you suggested)

    - pass the unique id from page to page in form action, links, hidden field e.t.c. so it can be referenced in the table.

    You now have the user tracked from page to page and can save data about him/her in your table.


    Cheers...

    Jason

  3. #3
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    See my post here it is an overview on how to use sessions to log people in and keep track of their username

    http://www.sitepointforums.com/showt...threadid=17643
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


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
  •