473,396 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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($_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
4 2823
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
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
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
Colin McKinnon wrote:


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

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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Uwe Mayer | last post by:
Hi, I want do use liburl to scan a webpage which is only accessible from within my LAN environment. While mozilla manages to load the target URL properly neither wget, nor liburl or liburl2...
1
by: Mike | last post by:
Hello, I want to read and write key'ed cookies from both javascript and ASP. I can't find any javascript that reads and writes cookies with keys, so that it is compatible with ASP like the...
0
by: bb | last post by:
Hello In my Session_OnStart in Global.asa, I am setting some cookies. One of them, I set as follows: dim UserID UserID = Request.ServerVariables("LOGON_USER") Response.Cookies("User")("ID")...
1
by: Mike | last post by:
Hello, I can't find any javascript that reads and writes cookies with keys, so that it is compatible with ASP (I want to read and write cookies from both javascript and ASP) for example in...
1
by: Robert Oschler | last post by:
I have two sites, both with valid P3P policies that passed the W3C P3P validator, including the P3P compliant HTTP headers test. On one of the sites, Site A, I have a web page that loads a...
1
by: feng | last post by:
I need to create cookies in user's machine from my ASP.Net code and I also need to read them. How do I do that? What is the API (name space?) for this in APS.Net? Thanks
3
by: Brian Kitt | last post by:
Ok. I know this sounds like a stupid question, but I'm really beside myself here. I've worked with cookies for years, so I know how they work, but I am new to C#, so apparently I'm doing...
1
by: Doogie | last post by:
Hi, I am having a problem reading a cookie that I can see is being created. I create the cookie in my global.aspx.vb page like so: Sub Session_Start(ByVal sender As Object, ByVal e As...
1
by: JohnathanKong | last post by:
Hello, I hope this is the right place to post, but anyways, here goes. I current have a forum, snitz, in place, but am having an IE specific problem. Basically what happens is, I have a page that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.