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

where are cookies stored ?

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

I looked in
C:\Users\MyUserNameAppData\Roaming\Microsoft\Windo ws\Cookies

there are some cookies but the cookie I use in my webapp must be
stored somewhere else since
when I delete all cookies in this directory, my webapp still
recognises my cookie to be alive ... but where is it?

thank you
Chris
Aug 24 '08 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Usually in C:\Users\Username\AppData\Roaming\Microsoft\Window s\Cookiesortype
Start and type shell:cookies, press enter and it will opne the folder for
you.

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
<cm****@gmail.comwrote in message
news:be**********************************@x41g2000 hsb.googlegroups.com...
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

I looked in
C:\Users\MyUserNameAppData\Roaming\Microsoft\Windo ws\Cookies

there are some cookies but the cookie I use in my webapp must be
stored somewhere else since
when I delete all cookies in this directory, my webapp still
recognises my cookie to be alive ... but where is it?

thank you
Chris

Aug 24 '08 #2

P: n/a
Cookies in Vista are stored at:

Drive:\Users\(User Name)\AppData\Roaming\Microsoft\Windows\Cookies\Lo w
AND
Drive:\Users\(User Name)\AppData\Roaming\Microsoft\Windows\Cookies

http://www.vistax64.com/tutorials/60641-cookies.html

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espańol : http://asp.net.do/foros/
======================================

<cm****@gmail.comwrote in message news:be**********************************@x41g2000 hsb.googlegroups.com...
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

I looked in
C:\Users\MyUserNameAppData\Roaming\Microsoft\Windo ws\Cookies

there are some cookies but the cookie I use in my webapp must be
stored somewhere else since
when I delete all cookies in this directory, my webapp still
recognises my cookie to be alive ... but where is it?

thank you
Chris


Aug 24 '08 #3

P: n/a
....AND in the Temporary Internet Files folder which you can't see without turning off UAC

You will have to also uncheck the *Hide protected operating system files*
option in Folder Options to see those files

CCleaner has a great cookie manager (Options, Cookies) feature in it,
and can delete (Cleaner option) all of the cookies to.

You might want to give it a try.

CCleaner : http://www.ccleaner.com/


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espańol : http://asp.net.do/foros/
======================================

"Juan T. Llibre" <no***********@nowhere.comwrote in message news:ez**************@TK2MSFTNGP04.phx.gbl...
Cookies in Vista are stored at:

Drive:\Users\(User Name)\AppData\Roaming\Microsoft\Windows\Cookies\Lo w
AND
Drive:\Users\(User Name)\AppData\Roaming\Microsoft\Windows\Cookies

http://www.vistax64.com/tutorials/60641-cookies.html

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espańol : http://asp.net.do/foros/
======================================

<cm****@gmail.comwrote in message news:be**********************************@x41g2000 hsb.googlegroups.com...
>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

I looked in
C:\Users\MyUserNameAppData\Roaming\Microsoft\Windo ws\Cookies

there are some cookies but the cookie I use in my webapp must be
stored somewhere else since
when I delete all cookies in this directory, my webapp still
recognises my cookie to be alive ... but where is it?

thank you
Chris



Aug 24 '08 #4

P: n/a
cm****@gmail.com wrote:
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

I looked in
C:\Users\MyUserNameAppData\Roaming\Microsoft\Windo ws\Cookies

there are some cookies but the cookie I use in my webapp must be
stored somewhere else since
when I delete all cookies in this directory, my webapp still
recognises my cookie to be alive ... but where is it?

thank you
Chris
Nowhere.

A session cookie is only stored in memory. You have to set the
expiration date of the cookie to make it persistent, then it will be
stored as a file.

--
Göran Andersson
_____
http://www.guffa.com
Aug 24 '08 #5

P: n/a
On Aug 25, 1:16 am, Göran Andersson <gu...@guffa.comwrote:
cmr...@gmail.com wrote:
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
I looked in
C:\Users\MyUserNameAppData\Roaming\Microsoft\Windo ws\Cookies
there are some cookies but the cookie I use in my webapp must be
stored somewhere else since
when I delete all cookies in this directory, my webapp still
recognises my cookie to be alive ... but where is it?
thank you
Chris

Nowhere.

A session cookie is only stored in memory. You have to set the
expiration date of the cookie to make it persistent, then it will be
stored as a file.

--
Göran Andersson
_____http://www.guffa.com
hello,

thank you all for your suggestions but I still have my problem !!

I looked in
C:\Users\MyUserNameAppData\Roaming\Microsoft\Windo ws\Cookies
C:\Users\MyUserNameAppData\Roaming\Microsoft\Windo ws\Cookies\Low
and in Temporary Internet Files folder,

deleted everything in the folders, reload my file in the browser but
it still uses information stored in a cookie

maybe you can give it a try, it is a small html application (listing
available at the end of this message)

I have a main file : "counter.html" that shows a collection of CDs
In that file, a counter is holding track of the amount of times the
user has visited the page (basically the counter increases after every
refresh in the browser)
once a maximum is reached the user is redirected to the other file
"signup.html"

so, what I try to do is 'reset' the application by deleting the cookie
physically or by resetting the counter inside the cookie just by
editing it
but for that I need to know where the cookie is located
The purpose of my app is to show students how fragile cookies are and
to be able to show them WHERE cookies are located !

thank you for giving it a try
**************************************************
the content of signup.html
**************************************************
<html>
<head>
<title></title>
</head>

<body>
<h1>
You reached the maximum amount of visits to this site.
<br />
You need to sign up if you want to use it again....</h1>
</body>
</html>

**************************************************
the content of counter.html:
**************************************************
<html>
<head>
<title>Using cookies to create a personal Web page hit counter </
title>

<script type="text/javascript" language="javascript">

function getCookie(name)
{
for (var i=0; i < bytes.length; i++)
{
nextbite = bytes[i].split("="); // break into name and value

if (nextbite[0] == name) // if name matches
return unescape(nextbite[1]); // return value
}
return null;
} // getCookie()

function setCookie(name, value)
{
if (value != null && value != "")
document.cookie= name + "=" + escape(value)
+ "; expires="
+ expiry.toGMTString();
bytes = document.cookie.split("; "); // update cookie bytes
} // setCookie()

var bytes = document.cookie.split("; ");
var today = new Date();
var expiry = new Date(today.getTime()+28*24*60*60*1000);

var headCount = getCookie("headCount");
var userName = getCookie("userName");
if (headCount == null)
headCount = 1;
if (userName == null)
{
userName = prompt("Please Enter Your Name:", "Anonymous");
if (userName == null || userName == "")
userName="Anonymous";
}
if (headCount == 1) // welcome for first visit
{
alert("Welcome, " + userName + ", this is your first visit");
}
else if (headCount <= 10)
{
alert("Welcome back " + userName + "\r\nYou have been here "
+ headCount + " time(s).");
}
else
window.location = "signup.html";

headCount++;

setCookie("headCount", headCount);
setCookie("userName", userName);

</script>

</head>
<body>
<h1>
Welcome</h1>
<h2>
CD Collection</h2>
<table border="1" id="Table1">
<tr bgcolor="#9acd32">
<th align="left">
Title
</th>
<th align="left">
Artist
</th>
</tr>
<tr>
<td>
CD Title1
</td>
<td>
Artist1
</td>
</tr>
<tr>
<td>
CD Title2
</td>
<td>
Artist2
</td>
</tr>
<tr>
<td>
CD Title3
</td>
<td>
Artist3
</td>
</tr>
</table>
</body>
</html>
Aug 25 '08 #6

P: n/a
On Aug 25, 1:16 am, Göran Andersson <gu...@guffa.comwrote:
cmr...@gmail.com wrote:
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
I looked in
C:\Users\MyUserNameAppData\Roaming\Microsoft\Windo ws\Cookies
there are some cookies but the cookie I use in my webapp must be
stored somewhere else since
when I delete all cookies in this directory, my webapp still
recognises my cookie to be alive ... but where is it?
thank you
Chris

Nowhere.

A session cookie is only stored in memory. You have to set the
expiration date of the cookie to make it persistent, then it will be
stored as a file.

--
Göran Andersson
_____http://www.guffa.com
hello,

thank you all for your suggestions but I still have my problem !!

I looked in
C:\Users\MyUserNameAppData\Roaming\Microsoft\Windo ws\Cookies
C:\Users\MyUserNameAppData\Roaming\Microsoft\Windo ws\Cookies\Low
and in Temporary Internet Files folder,

deleted everything in the folders, reload my file in the browser but
it still uses information stored in a cookie

maybe you can give it a try, it is a small html application (listing
available at the end of this message)

I have a main file : "counter.html" that shows a collection of CDs
In that file, a counter is holding track of the amount of times the
user has visited the page (basically the counter increases after every
refresh in the browser)
once a maximum is reached the user is redirected to the other file
"signup.html"

so, what I try to do is 'reset' the application by deleting the cookie
physically or by resetting the counter inside the cookie just by
editing it
but for that I need to know where the cookie is located
The purpose of my app is to show students how fragile cookies are and
to be able to show them WHERE cookies are located !

thank you for giving it a try

**************************************************
the content of signup.html
**************************************************
<html>
<head>
<title></title>
</head>

<body>
<h1>
You reached the maximum amount of visits to this site.
<br />
You need to sign up if you want to use it again....</h1>
</body>
</html>

**************************************************
the content of counter.html:
**************************************************
<html>
<head>
<title>Using cookies to create a personal Web page hit counter </
title>

<script type="text/javascript" language="javascript">

function getCookie(name)
{
for (var i=0; i < bytes.length; i++)
{
nextbite =
bytes[i].split("="); // break into name and value

if (nextbite[0] ==
name) // if name matches
return
unescape(nextbite[1]); // return value
}
return null;
} // getCookie()

function setCookie(name, value)
{
if (value != null && value != "")
document.cookie= name + "=" +
escape(value)

+ "; expires="

+ expiry.toGMTString();
bytes = document.cookie.split(";
"); // update cookie bytes
} // setCookie()

var bytes = document.cookie.split("; ");
var today = new Date();
var expiry = new Date(today.getTime()
+28*24*60*60*1000);

var headCount = getCookie("headCount");
var userName = getCookie("userName");
if (headCount == null)
headCount = 1;
if (userName == null)
{
userName = prompt("Please Enter Your Name:",
"Anonymous");
if (userName == null || userName == "")
userName="Anonymous";
}
if (headCount == 1) // welcome for first visit
{
alert("Welcome, " + userName + ", this is your
first visit");
}
else if (headCount <= 10)
{
alert("Welcome back " + userName + "\r\nYou
have been here "
+
headCount + " time(s).");
}
else
window.location = "signup.html";

headCount++;

setCookie("headCount", headCount);
setCookie("userName", userName);

</script>

</head>
<body>
<h1>
Welcome</h1>
<h2>
CD Collection</h2>
<table border="1" id="Table1">
<tr bgcolor="#9acd32">
<th align="left">
Title
</th>
<th align="left">
Artist
</th>
</tr>
<tr>
<td>
CD Title1
</td>
<td>
Artist1
</td>
</tr>
<tr>
<td>
CD Title2
</td>
<td>
Artist2
</td>
</tr>
<tr>
<td>
CD Title3
</td>
<td>
Artist3
</td>
</tr>
</table>
</body>
</html>
Aug 25 '08 #7

P: n/a
<snip />

Go to http://www.nirsoft.net/ and download the free utility IECookiesView it
is very very useful

Aug 25 '08 #8

This discussion thread is closed

Replies have been disabled for this discussion.