473,399 Members | 2,159 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,399 software developers and data experts.

How to determine if a function has set a cookie?


I'm using PHPUnit to test some PHP scripts and I'd like to know if there
is a means of checking which cookies have been set by setcookie() in a
function under test.

--
Ian Collins.
Feb 12 '07 #1
2 2046
Rik
Ian Collins wrote:
I'm using PHPUnit to test some PHP scripts and I'd like to know if there
is a means of checking which cookies have been set by setcookie() in a
function under test.
There is _no_ way to test which cookies have explicitly been set by
setcookie(). A cookie is a cookie, and can be set a lot of different ways.
You can check however which cookies this particular script tries to set:
<http://www.php.net/headers_list>.

And offcourse, you can monitor changes in the $_COOKIE array after a new
pagerequest.
--
Rik Wasmus
Feb 12 '07 #2
Rik wrote:
Ian Collins wrote:
>I'm using PHPUnit to test some PHP scripts and I'd like to know if there
is a means of checking which cookies have been set by setcookie() in a
function under test.


There is _no_ way to test which cookies have explicitly been set by
setcookie(). A cookie is a cookie, and can be set a lot of different
ways. You can check however which cookies this particular script tries
to set: <http://www.php.net/headers_list>.
Thanks Rik, that's exactly what I'm after.

--
Ian Collins.
Feb 12 '07 #3

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

Similar topics

12
by: siliconmike | last post by:
I'm just lost here.. Is there a function to determine current time on the client's computer clock ? Links / Pointers? Mike
4
by: Yvan J. Gagnon | last post by:
I am encountering a strange problem in Netscape 7 with a CFM file I am trying to troubleshoot (the page is working fine in NS Communicator and IE). Below is a sample of the problematic line of...
3
by: lucpustjens | last post by:
Hello, I want te determine the client operating system, because I need to kno the default cookie directory. If there is a way to determine the cooki directory directly, than it is also good. ...
2
by: shree | last post by:
Hi all, I'm trying to call javascript function via onLoad but running into a problem. I would appreciate any help and suggestion. My application is as follows. When a page loads, I want to check...
1
by: Anita C | last post by:
Hi, How cookies can be used to set and then determine the last page visited by a person browsing a particular website ? Also the page last visited is loaded in an iframe, so the page last visited...
0
by: Brett Smith | last post by:
I have a winforms app that access a web resource using forms authentication. I programatically login to the site, and catch the cookies. I then pass the cookies to my httpwebrequest. I neet to...
1
by: mens libertina | last post by:
Hello, I am programming a little game, and I want the focus to move from one input box to the next as the user types. I have image-input pairs so the user is typing a letter under a picture. ...
11
by: yangsuli | last post by:
i want to creat a link when somebody click the link the php script calls a function,then display itself :) i have tried <a href=<? funtion(); echo=$_server ?>text</a> but it will call the...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.