473,598 Members | 2,916 Online
Bytes | Software Development & Data Engineering Community
+ 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 5975
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 fefsensmrrjyahe eoceoq\! | 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.go ogle.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
2809
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 missing the big picture. Is it like this: 1. user comes to site 2. user does something (e.g. a search) that may be useful later => session
4
3865
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 new site I goto seems to prompt me to store their cookie. The other is Pocket IE on Pocket PC 2002, with the cookies set to 'enabled'. My problem is that the cookies dont seem to be being written with my ASP. I dont get the prompt to store...
2
3332
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 the user. I want that cookie should get deleted when user closes the browser without signing out. I think it is done in global.asa file . But i don;t know how to do it?
1
3173
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 categor(ies) JavaScript cookies fall under, according to Internet Explorer's help.cfm. What I don't understand is where do JavaScript cookies fall under the help.cfm definition. Maybe I'm not reading "their" English properly? (See below.) "Persistent -...
2
6039
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 accept cookies, what can you do as alternative for storing that data? What is the tradeoff if you just set the cookieless=true? I am just trying to determine a set of best practices for this on my project.
1
1036
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 not read the cookies. This is if block third part cookies is enabled. If I allow third party cookies then it will work. If I display the cookie collection it will show a count of zero. I can
3
4104
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 storing data in the cache object, in a viewstate and in a Session. I can say Cache("MyData")=objDataSet as well as
3
2625
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 could not find the stored cookie,it was gone . my code -----------------
0
8284
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6711
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...
1
5847
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5437
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
3894
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3938
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1500
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1245
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.