473,480 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to capture cookies information

I am very new with php. And I want to find out how do I capture user
cookies information for traffic analysis on Windows machine and server
cookies from Linux server.

thanks.
Jul 17 '05 #1
2 5959
xo55ox wrote:
I am very new with php. And I want to find out how do I capture user
cookies information for traffic analysis on Windows machine and server
cookies from Linux server.


See the setcookie() section of the PHP manual.

setcookie() will ask the user's browser to save a little file onto their
machine containing the values you specify in setcookie(), but it is
possible for the user's browser to refuse to set a cookie if the user
has turned cookies off (unlikely) or if they reject the cookie
personally (also fairly unlikely), or if your script is not the URL in
the browser's address bar (making you a third-party to the Web
transaction) recent browsers tend to reject third-party cookies (pretty
likely and increasingly so).

setcookie() must be called before any data has been sent (it's like the
header() function).

If setcookie() is successful, you can then see the values your site set
(and only the values *your* site set) in the $_COOKIE variable on the
page AFTER THE PAGE THAT USES setcookie() AND NOT BEFORE. The first
cookie mistake some people make is trying to look at stored cookie
values before they've been stored.
--
Bob
London, UK
echo Mail fefsensmrrjyaheeoceoq\! | tr "jefroq\!" "@obe.uk"
Jul 17 '05 #2
Hi,

Try using setcookie to set the cookie and $_COOKIE to retrieve it when
you need it. Note that to set the cookie, you will have to do this
before any other information is sent to the web browser of the
visitor.

Success,

Paul
xo****@hotmail.com (xo55ox) wrote in message news:<ab**************************@posting.google. com>...
I am very new with php. And I want to find out how do I capture user
cookies information for traffic analysis on Windows machine and server
cookies from Linux server.

thanks.

Jul 17 '05 #3

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

Similar topics

2
1078
by: xo55ox | last post by:
Hi, I am new to php scripting and want to find out how to capture cookies from user machines such as from Windows or linux machine. Thanks in advance.
1
2788
by: windandwaves | last post by:
Hi Gurus I am basically sorry that I have to bother you about this. I am a PHP beginner and I have been studying sessions and cookies over the last few weeks. I have learned lots, but I am...
4
3854
by: Brian Burgess | last post by:
Hi all, Anyone know of any special issues with storing cookies with ASP? I'm trying this with two browsers: One is IE 6.0 with cookies set to 'prompt'. This has been working properly as any...
2
3319
by: Amit D.Shinde | last post by:
Hello Experts.. I need some help regarding cookies and session objects and also global.asa file I am creating one cookie when a user logs in on my website. The cookie stores the login name of...
1
3165
by: John Taylor-Johnston | last post by:
I'm a University academic looking for a proper definition of JavaScript Cookies. http://www.CollegeSherbrooke.qc.ca/languesmodernes/604-HAE_Grammar_Practice/ I'm trying to decipher what...
2
6029
by: Robert V. Hanson | last post by:
If you have per user information that you want to store in session and the setting in web.config is set to cookieless=false so you are intending on using cookies, the user's browser is set to not...
1
1026
by: Ted Bogucki | last post by:
using asp.net I can write out cookies using response.cookies and read cooies with request.cookies If I enable a firewall like zonealarm then the cookies wiill write out but the asp page will...
3
4096
by: Alex Nitulescu | last post by:
Sorry, I'm really confused - I'm only at the middle of my book and already I can count 4 methods to store values. Yes, I know that cookies can not store much, but what is the difference between...
3
2618
by: Raghu Raman | last post by:
Hi, I want to store a cookie peemanently for 2 days.From msdn article, i have coded like this.It is working when i run my application .But if i close my browser and restart my application , i...
0
7033
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,...
0
6903
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
7027
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
7071
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
6861
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...
1
4763
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...
0
2974
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
557
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
170
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...

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.