473,799 Members | 3,267 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Jul 17 '05 #1
4 2844
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($_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...


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($_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

Jul 17 '05 #3
Duncan <du****@dotcomw orld.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($_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


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
2315
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 does. I had a closer look at the html source and discovered a lot of Javascript, including Cookies. My suspicion is that the Javascript code needs to be executed for the page to work properly. Also I don't know how liburl deals with Cookies, but
1
4380
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 following: <% Response.Cookies("user")("firstname")="John" Response.Cookies("user")("lastname")="Smith"
0
2720
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") = UCASE(UserID) When I immediately log the cookie value retrieved from
1
2225
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 ASP: <% Response.Cookies("user")("firstname")="John" Response.Cookies("user")("lastname")="Smith"
1
5440
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 document from Site B in an IFRAME. In this context the web page on Site A is the "originating" document and the web page on Site B is a 3rd-party document (since it's from a different domain). I thought that having a valid P3P policy would make IE6...
1
1546
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
4945
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 something wrong with C#. I'm saving a cookie (user preferences) that I want to load again the next time a user visits my site. I know it's saving correctly, I can see it in the temporary internet files. But my first page (Default.aspx) is trying to...
1
1180
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 EventArgs) Dim user As String = Current.User.Identity.Name Dim roleCookieName As String = user & "-Roles" Dim rolesList As String = Response.Cookies(roleCookieName ).Value 'Only try to create the cookie if it is not already created.
1
2236
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 drops a cookie which logs in the user. This all works fine, but once the cookie is dropped ALL post method data from forms become empty. Get works, and if I post data to a different site it works, so the break down is reading the data from the post....
0
9688
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10260
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10030
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9078
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5590
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4146
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.