Storing sessions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pedjasmek
    New Member
    • Oct 2007
    • 15

    Storing sessions

    Can anyone tell me what is the best way to store sessions into database in order to recognize that user next time he access the site?I thought about IP address but then I remembered that it is different every time.What thing regarding a user is always the same?
  • MarkoKlacar
    Recognized Expert Contributor
    • Aug 2007
    • 296

    #2
    Hi,

    the best practice for this is to store a username and a password.
    When a user logs in, you can start a session based upon his username.
    Start with this.

    Let me know if you need some more information.

    Cheers

    Comment

    • pedjasmek
      New Member
      • Oct 2007
      • 15

      #3
      I came up with the same idea but I want to know something else.Assume that certain user wants to remain logged in that means that he doesn't need to fill in username and password fields again.How can I know that it's him again?

      Comment

      • ak1dnar
        Recognized Expert Top Contributor
        • Jan 2007
        • 1584

        #4
        First, why you need to track the user visits? as an example, do you want to store some customized style settings for individual users?
        You can get the IP address of the user, but how do you plan to filter the users with shared IPs.

        Comment

        • pedjasmek
          New Member
          • Oct 2007
          • 15

          #5
          I could make some kind of voting system allowing users to vote only once in,say,24 hours or similar.This is just one example.Now you see why I've posted the question

          Comment

          • ak1dnar
            Recognized Expert Top Contributor
            • Jan 2007
            • 1584

            #6
            There are lots of sample scripts you can find by googling. Thanks.

            Comment

            • Atli
              Recognized Expert Expert
              • Nov 2006
              • 5062

              #7
              Hi.

              Have you considered using Cookies?

              Comment

              Working...