473,387 Members | 1,757 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,387 software developers and data experts.

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 5955
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
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
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
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
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
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
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
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
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
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
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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,...

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.