By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,872 Members | 2,392 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,872 IT Pros & Developers. It's quick & easy.

cant read cookies

P: n/a
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($_COOKIE) 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
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Duncan wrote:
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($_COOKIE) 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...


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.

Jul 17 '05 #2

P: n/a
Colin McKinnon wrote:

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.


It's not not the firewall, it happens on other computers too. What
could prevent cookies being read? As mentioned before even
var_dump($_COOKIES) and print_r($_COOKIES) 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

Jul 17 '05 #3

P: n/a
Duncan <du****@dotcomworld.co.za> wrote:
It's not not the firewall, it happens on other computers too. What
could prevent cookies being read? As mentioned before even
var_dump($_COOKIES) and print_r($_COOKIES) 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


It's always a (very) _good_ idea to set errors to E_ALL when developing:
http://www.php.net/manual/en/reserve...iables.cookies

Helps avoiding these stupid typos :)

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

Jul 17 '05 #4

P: n/a
Colin McKinnon wrote:


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

Another thread started in alt.php
JW
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.