Cookie

Discussion in 'PHP' started by fr33d0m, Aug 2, 2007.

  1. #1
    Hi, can someone teach me how to use cookie?
    I have tried to setup a unique cookie, but it doesn't work.
    When i open a new browser, they will share the same cookie.
    Can someone guide me how to avoid this? I want something like what Yahoo mail do, i.e everytime i open a new browser it will link me to my index.php.
    Thanks in advance...
     
    fr33d0m, Aug 2, 2007 IP
  2. adsblog

    adsblog Active Member

    Messages:
    659
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    70
    #2
    adsblog, Aug 2, 2007 IP
  3. exodus

    exodus Well-Known Member

    Messages:
    1,900
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    165
    #3
    Everytime you open a new browser. Meaning it is the same browser using the same cookie (same session). If you login in IE. Then open Firefox and login. It would require you to login again (different sessions). Cookies are unique per person per browser.

    Cookies will be shared amoung the same browser, because it is considered to be the same session. It is not impossible, but I would guess it would be hard to detect on the server site that the clients side browser opened a new browser window.
     
    exodus, Aug 2, 2007 IP
  4. fr33d0m

    fr33d0m Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks for the replies :)
    Exodus :
    After reading your reply that it's quite difficult to detect from server side whether client opens a new window or not. I decided to use a simple way to solve my problem :p I put some checking in my first script, if there is a cookie that has been set, i'll redirect user to index.php.
    Thanks again for your reply :)
     
    fr33d0m, Aug 2, 2007 IP