what is the need of cookie..

Discussion in 'PHP' started by bhuppi890109, Apr 25, 2011.

  1. #1
    i have a confusion ...if textboxes shows the previous entered data in the browser..then what is the need to set the cookie in php. ..i know it is used to identify the user but what is main need of cookie???
     
    bhuppi890109, Apr 25, 2011 IP
  2. subdivisions

    subdivisions Well-Known Member

    Messages:
    1,021
    Likes Received:
    40
    Best Answers:
    1
    Trophy Points:
    145
    #2
    Cookies are used to keep the used logged in constantly. Instead of having to log in on every page, their details are stored in a cookie which the site reads.
     
    subdivisions, Apr 25, 2011 IP
  3. bhuppi890109

    bhuppi890109 Member

    Messages:
    1,337
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    48
    #3
    it can be done with the help of session then why we use cookies?
     
    bhuppi890109, Apr 25, 2011 IP
  4. subdivisions

    subdivisions Well-Known Member

    Messages:
    1,021
    Likes Received:
    40
    Best Answers:
    1
    Trophy Points:
    145
    #4
    Sessions are stored on the server, cookies are stored on the visitor's computer. If you use sessions on a high traffic website, your server will run out of memory pretty quickly.

    Worth noting that since cookies can be seen by the user, you should make sure their data is encrypted.
     
    subdivisions, Apr 25, 2011 IP
  5. bhuppi890109

    bhuppi890109 Member

    Messages:
    1,337
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    48
    #5
    ok thanks subdivisions...
     
    bhuppi890109, Apr 25, 2011 IP