cant read cookies

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Duncan

    cant read cookies

    Hi

    I'm doing a site that creates a cookie and then needs to read that
    cookie later.
    The cookie is created fin and I can see it in my browsers cookies but I
    can't seem to read it. I've tried referring to the variable straight as
    $cookie_var and as $_COOKIE['cookie_var'] but no luck.
    if I var_dump($_COOK IE) I get
    array(0) { }

    Is there something silly I'm missing? I thought it may be my firewall so
    I got someone else to check and same story...

    Thanks
  • Colin McKinnon

    #2
    Re: cant read cookies

    Duncan wrote:
    [color=blue]
    > Hi
    >
    > I'm doing a site that creates a cookie and then needs to read that
    > cookie later.
    > The cookie is created fin and I can see it in my browsers cookies but I
    > can't seem to read it. I've tried referring to the variable straight as
    > $cookie_var and as $_COOKIE['cookie_var'] but no luck.
    > if I var_dump($_COOK IE) I get
    > array(0) { }
    >
    > Is there something silly I'm missing? I thought it may be my firewall so
    > I got someone else to check and same story...
    >[/color]

    Sounds like a very clever firewall with a very dumb config if it can block
    cookies - do cookies work on other sites?

    Have you tried setting and reading a cookie from the same script - maybe its
    a path issue.

    HTH

    C.

    Comment

    • Duncan

      #3
      Re: cant read cookies

      Colin McKinnon wrote:[color=blue]
      >
      > Sounds like a very clever firewall with a very dumb config if it can block
      > cookies - do cookies work on other sites?
      >
      > Have you tried setting and reading a cookie from the same script - maybe its
      > a path issue.[/color]

      It's not not the firewall, it happens on other computers too. What
      could prevent cookies being read? As mentioned before even
      var_dump($_COOK IES) and print_r($_COOKI ES) show no cookies at all. There
      isn't a cookie_start() function or something like sessions is there? or
      could it be a server thing? I'm stumped

      Comment

      • Daniel Tryba

        #4
        Re: cant read cookies

        Duncan <duncan@dotcomw orld.co.za> wrote:[color=blue]
        > It's not not the firewall, it happens on other computers too. What
        > could prevent cookies being read? As mentioned before even
        > var_dump($_COOK IES) and print_r($_COOKI ES) show no cookies at all. There
        > isn't a cookie_start() function or something like sessions is there? or
        > could it be a server thing? I'm stumped[/color]

        It's always a (very) _good_ idea to set errors to E_ALL when developing:


        Helps avoiding these stupid typos :)

        Also read http://nl3.php.net/manual/en/function.setcookie.php carefully,
        especially the "Common Pitfalls" section.

        Comment

        • Janwillem Borleffs

          #5
          Re: cant read cookies

          Colin McKinnon wrote:[color=blue]
          >[/color]

          Multiposters should be banned from usenet... DO NOT MULTIPOST!

          Another thread started in alt.php


          JW


          Comment

          Working...