_COOKIE[] unique?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • newtophp2000@yahoo.com

    _COOKIE[] unique?

    I may be getting confused over nothing here but ...

    I was wondering if the _COOKIE global is unqiue to each visitor or is
    it global across all visitor sessions? If it is truly global on the
    server side, is it possible that a cookie from one user's session may
    corrupt another user's session? How would I know which cookie goes
    with which user session/browser?

  • Lüpher Cypher

    #2
    Re: _COOKIE[] unique?

    newtophp2000@ya hoo.com wrote:[color=blue]
    > I may be getting confused over nothing here but ...
    >
    > I was wondering if the _COOKIE global is unqiue to each visitor or is
    > it global across all visitor sessions? If it is truly global on the
    > server side, is it possible that a cookie from one user's session may
    > corrupt another user's session? How would I know which cookie goes
    > with which user session/browser?
    >[/color]

    $_COOKIE will only have cookies for current visitor, I believe they are
    sent over via http request :) Global in this context means that $_COOKIE
    is accessible from anywhere in the script, not that it has the cookies
    of all user sessions.


    luph

    Comment

    • Janwillem Borleffs

      #3
      Re: _COOKIE[] unique?

      newtophp2000@ya hoo.com wrote:[color=blue]
      > I was wondering if the _COOKIE global is unqiue to each visitor or is
      > it global across all visitor sessions? If it is truly global on the
      > server side, is it possible that a cookie from one user's session may
      > corrupt another user's session? How would I know which cookie goes
      > with which user session/browser?
      >[/color]

      The _COOKIE variable is only global in the sence of being available in every
      namespace without an explicit import (e.g. with the global keyword).

      Each cookie created for a user is unique to that user because it's written
      to his or her system. The browser adds a Cookie header to the request when
      it finds a match on the local file system for a specific page.

      When you create a cookie containing a user or session ID for user A, this
      user's browser will send the ID back to the server when the appropriate page
      is requested. Of course, when another user has access to user A's system and
      browser, he or she will be recognized as user A while he or she isn't.


      HTH;
      JW


      Comment

      • Jerry Stuckle

        #4
        Re: _COOKIE[] unique?

        newtophp2000@ya hoo.com wrote:[color=blue]
        > I may be getting confused over nothing here but ...
        >
        > I was wondering if the _COOKIE global is unqiue to each visitor or is
        > it global across all visitor sessions? If it is truly global on the
        > server side, is it possible that a cookie from one user's session may
        > corrupt another user's session? How would I know which cookie goes
        > with which user session/browser?
        >[/color]

        $_COOKIE is unique to the user's browser session. The cookie is stored
        on the user's system.

        --
        =============== ===
        Remove the "x" from my email address
        Jerry Stuckle
        JDS Computer Training Corp.
        jstucklex@attgl obal.net
        =============== ===

        Comment

        • newtophp2000@yahoo.com

          #5
          Re: _COOKIE[] unique?

          Thanks to all for the clarification! It all makes a lot of sense now.

          Comment

          Working...