when do cookie write to disk?
Moderator: General Moderators
when do cookie write to disk?
I am reading a book of Morrison, which tell me that cookie is write to disk when the browser is turned off.
But my understanding is that when cookie is created.
Anyone knows which one is right? Thanks.
But my understanding is that when cookie is created.
Anyone knows which one is right? Thanks.
Re: when do cookie write to disk?
Depends on the browser.
Re: when do cookie write to disk?
could you please tell me which browser is which. How can I find out the policy of my browser?
Re: when do cookie write to disk?
No, because I don't know. And I'd be very surprised if anybody who doesn't actually write code for a browser knew.
As for finding out, your options are:
- Download the source of the various browsers (the ones that provide source) and see what the code does
- Ask on a mailing list and/or forum dedicated to the development of each browser
- Google it
As for finding out, your options are:
- Download the source of the various browsers (the ones that provide source) and see what the code does
- Ask on a mailing list and/or forum dedicated to the development of each browser
- Google it
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: when do cookie write to disk?
Which book, Javascript Bible?wvoyance wrote:I am reading a book of Morrison
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Re: when do cookie write to disk?
The cookie is created the moment the browser receives the headers telling it to create a cookie. That cookie is stored in RAM. At various times (dependant on the browser), that cookie will be written to hard disk so it can be stored long term. As far as a web developer is concerned, when this happens doesn't matter. Nothing changes as far as the data that can be accessed or stored via the cookie.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: when do cookie write to disk?
Found this in the aforementioned book
As you experiment with browser’s cookies, you will be tempted to look into the cookie file after a script writes some data to the cookie. The cookie file usually will not contain the newly
written data, because in most browsers cookies are transferred to disk only when the user quits the browser; conversely, the cookie file is read into the browser’s memory when it is launched. While you read, write, and delete cookies during a browser session, all activity is performed in memory (to speed up the process) to be saved later.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Re: when do cookie write to disk?
Head First Javascript byMichael Morrison on Chapter 3 when it talk about cookie there is a picture.social_experiment wrote:Which book, Javascript Bible?wvoyance wrote:I am reading a book of Morrison
What I read is a translate version, therefore cannot tell you exactly ISBN and page number.
Re: when do cookie write to disk?
Later in the same book, there is a talk between "variable" and "cookie" which I do not think quite right.social_experiment wrote:Found this in the aforementioned bookAs you experiment with browser’s cookies, you will be tempted to look into the cookie file after a script writes some data to the cookie. The cookie file usually will not contain the newly
written data, because in most browsers cookies are transferred to disk only when the user quits the browser; conversely, the cookie file is read into the browser’s memory when it is launched. While you read, write, and delete cookies during a browser session, all activity is performed in memory (to speed up the process) to be saved later.
They said cookie use table while variable not. Actually compiler generate table for variables.