473,749 Members | 2,384 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

where does php place cookies?

Hello all,

This is baffling me. I am starting a session and I know it is setting a
cookie on my computer - I called getallheaders() and see that it is
setting the cookie, and it is also accessible in $_COOKIE. I cleared
all cookies in my Cookies folder before starting the session, and
everytime I run the script it does not create a cookie in the folder.
For testing I even set the browser to accept all cookies to make sure.

session.use_coo kies is on in php.ini, session.use_onl y_cookies is off,
and session.use_tra ns_sid is off. The session data file is definitely
being created, but I cannot find the corresponding cookie no matter what
I try.

Thanks in advance for all your help.
Oct 4 '05 #1
6 2117
On Tue, 04 Oct 2005 04:11:07 GMT, Marcus <Ju********@aol .com> wrote:
This is baffling me. I am starting a session and I know it is setting a
cookie on my computer - I called getallheaders() and see that it is
setting the cookie, and it is also accessible in $_COOKIE.


PHP sessions use so-called "session cookies" -- they are not
perminently stored and disappear when you close your browser. Thus
they are never written to you cookies folder.

Oct 4 '05 #2
Wayne wrote:
On Tue, 04 Oct 2005 04:11:07 GMT, Marcus <Ju********@aol .com> wrote:

This is baffling me. I am starting a session and I know it is setting a
cookie on my computer - I called getallheaders() and see that it is
setting the cookie, and it is also accessible in $_COOKIE.

PHP sessions use so-called "session cookies" -- they are not
perminently stored and disappear when you close your browser. Thus
they are never written to you cookies folder.


That explains a lot. :-) Thanks Wayne.

Are they put in any other directory, or do they just reside in the
server's RAM or some other temporary storage device?
Oct 4 '05 #3
Marcus wrote:
Wayne wrote: [snip]
That explains a lot. :-) Thanks Wayne.

Are they put in any other directory, or do they just reside in the
server's RAM or some other temporary storage device?


They reside in *your computer's RAM* allocated by the browser, not on
the server side. They are never written to disk (until you are short of
free RAM - then you can maybe find them in your swapfile/swap partition :))

Y.
Oct 4 '05 #4
On Tue, 04 Oct 2005 06:13:34 GMT, Marcus <Ju********@aol .com> wrote:
Are they put in any other directory, or do they just reside in the
server's RAM or some other temporary storage device?


I assume you mean client's RAM not server's RAM -- and yes, that is
where they reside.

Oct 4 '05 #5
Wayne wrote:
On Tue, 04 Oct 2005 06:13:34 GMT, Marcus <Ju********@aol .com> wrote:

Are they put in any other directory, or do they just reside in the
server's RAM or some other temporary storage device?

I assume you mean client's RAM not server's RAM -- and yes, that is
where they reside.


Yes, I'm sorry, I spent 10 hours straight coding and researching stuff,
and my brain was fried at 1 am. :-)

If it does reside in RAM, how can you set it to have a lifetime of
years? Once the user turns the computer off, doesn't this flush the
system memory and thus kill any cookie settings that were set?
Oct 4 '05 #6
>If it does reside in RAM, how can you set it to have a lifetime of
years? Once the user turns the computer off, doesn't this flush the
system memory and thus kill any cookie settings that were set?


Look at the PHP documentation for setcookie(). A session-only
cookie (one created by calling setcookie with an expire time of 0)
will expire when the browser is closed. It doesn't have an expire
time, and might manage to last more than 2 years if the browser
stays open that long. It's not stored on disk, at least in most
browsers.

A non-session-only cookie will have an expire time, often given to
setcookie() as time() + a number of seconds to last. These cookies
will be stored on disk somewhere. Where depends on the browser,
but it's likely to be in a similar place to where the browser
configuration parameters are stored.

Gordon L. Burditt
Oct 4 '05 #7

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

Similar topics

2
3656
by: mark4asp | last post by:
Hello, I'm running my script locally and the cookie has been saved on the machine because the login page is by-passed (with the Redirect to "menu.asp" below. OK - but where is my cookie stored? Or at least give me clue. What will the cookie be called and what text will it contain if: iAuthorID = 1 iSecurityLvl = 3
3
4210
by: HorseGeek | last post by:
I can't find a cookie that my code is writing. The behavior of my webpages indicates that the cookie IS being written SOMEPLACE. However, I can't find it. My client does not want the code going into production unless they can actually see where the cookie is being written. They are concerned that the cookie may stay around after they leave the screen and grant authorization to other users to get to web pages that they are now allowed...
2
2348
by: Harry Haller | last post by:
Why does the following work: // (1) Set new cookies setcookie ("font_type", $type_sel, time()+3600); setcookie ("font_size", $size_sel, time()+3600); // (1) Get most recent cookie $font_type = $_COOKIE; $font_size = $_COOKIE; if (isset($font_type) && isset($font_size)) echo "Found Cookies<br>\n";
1
1461
by: Jason Shohet | last post by:
I need to get the computer name that the user's browser is on (intranet app here). We don't want Netbios turned on. So, when the user logs in, the network engineers have a file written onto the user's machine. Then, my .NET app is going to read from that text file -- ON THE USER'S MACHINE. How to do it... I'm thinking the only way is: Have the text file written to the place that .NET cookies are written to. Then I'll be able to...
7
7676
by: DC Gringo | last post by:
I was under the impression that when I create session variables such as session("myVar1"), they get stored on the client in a cookie. When I look in my Temporary Internet Files directory for the cookie, I don't see anything. Am I looking in the right place? Here are my session state settings, they are default: <!-- SESSION STATE SETTINGS By default ASP.NET uses cookies to identify which requests belong to a particular session.
3
12711
by: mosesdinakaran | last post by:
Hi Where does the cookies stored in the client machine that php creates after calling session_start() function. I am using IE... I checked in the following folders but no cookies are stored. 1)C:\Documents and Settings\Administrator\Local Settings\Temporary Internet Files
2
1676
by: Eric | last post by:
Hello, I'm trying to debug a problem that some users of our ASP app see that goes away when they clear their cookies. I've gotten a copy of their cookie for our app and have renamed it from them@testsite.txt to me@testsite.txt. However, when I navigate to testsite, I see it create a me@testsite.txt. What are the rules as far as what gets written to the C:\Documents and Settings\ %Username%\Cookies?
2
5012
by: StanB | last post by:
I came across this weird problem: 1. Session state stops working after the app is deployed to another server because IE does not accept cookies. 2. It works if cookieless="true" in the web.config 3. Yes, I tried IE - Tools - Privacy - Accept All Cookies and also Override automatic cookie handling, Always allow session cookes
7
10207
by: cmrchs | last post by:
Hi, In Windows Vista: where does asp.net write its cookies? I use HttpCookie objCookie = new HttpCookie("nameCookie"); in Win2000 (and later) they used to be in C:\Documents and Settings\Administrator\Cookies but not anymore
0
8996
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8832
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9388
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9254
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8256
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...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3319
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
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.