By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,613 Members | 1,890 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,613 IT Pros & Developers. It's quick & easy.

How to capture cookies information

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.