473,396 Members | 2,034 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How are cookies named when stored on a client machine?

Hi.

I'm trying to work with cookies from ASP and I've noticed cookies are stored on
my machine in two distinct forms. the first form is "Cookie:<user name>@<web
site>", which is a combination between my current logon ID and the visited web.
The second is "<name>".

I get the second form when I send a cookie from ASP script using the following
instructions:

<%@ Language=JavaScript %>
<%
function setCookie( szName, szValue )
{
Response.Cookies(szName).Item = szValue;
Response.Cookies(szName).Expires = "10/10/2004";
}
....
%>

The value in szName becomes the cookie name. Note however the cookie *address*
is like any others: "Cookie:<user name>@<web site>".

How did I get those cookies in the first form? Is the second form IIS-specific?

Thanks,
Vince C.
Jul 19 '05 #1
4 5105
Hi Vince,

Different browsers store cookies in different ways. Internet Explorer
stores the cookies for a site in a file whose name is in the format
<user>@<domain>.txt, where <user> is your account name. For example, if
your name is mikepope and you visit the site www.contoso.com, the cookies
for that site will be in a file called mi******@www.contoso.txt. (The name
might include a sequential number, such as mi******@www.contoso[1].txt.)
The cookie text files are user-specific, so they are isolated by account.

regarding the question, I think you first need ensure your logon as windows
account to that IE can found the user name and web site.

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 19 '05 #2
"MSFT" <lu******@online.microsoft.com> a écrit dans le message de
news:%2*****************@cpmsftngxa06.phx.gbl...
Hi Vince,

Different browsers store cookies in different ways. Internet Explorer
stores the cookies for a site in a file whose name is in the format
<user>@<domain>.txt, where <user> is your account name. For example, if
your name is mikepope and you visit the site www.contoso.com, the cookies
for that site will be in a file called mi******@www.contoso.txt. (The name
might include a sequential number, such as mi******@www.contoso[1].txt.)
The cookie text files are user-specific, so they are isolated by account.

regarding the question, I think you first need ensure your logon as windows
account to that IE can found the user name and web site.


Thanks, Luke.

However I was mistaken when I described the second form. Instead of "<name>" I
should have written "<folder>". For instance, I created a web application on my
machine; when I browse http://localhost/webfolder and there is a cookie
involved, it is named "/webfolder" instead of "Cookie:<logon name>@localhost".

I'd like to know why and when cookies are named differently. I mean the name
that is displayed when you browse your temporary Internet files folder and use
"Details" as a display mode. My cookie *file* name has the same syntax as the
others but the *name* of the cookie is different. So I was not talking about the
file name.

To make it short why and when do I have cookie names like "/webfolder" and
others like "Cookie:Vi****@yoursite.com"?

Vince C.
Jul 19 '05 #3
Hi Vince,

Cookie has the "path" property. If you put the asp file in "/AppName", the
cookie will be like

User@AppName

If you put it in the wwwroot folder, it will be like

User@localhost

or

User@ComputerName

If your web server has a domain name like "www.mydomain.com", it will be:

us**@domain.com

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 19 '05 #4
"MSFT" <lu******@online.microsoft.com> a écrit dans le message de
news:aF**************@cpmsftngxa06.phx.gbl...
Hi Vince,

Cookie has the "path" property. If you put the asp file in "/AppName", the
cookie will be like

User@AppName

If you put it in the wwwroot folder, it will be like

User@localhost

or

User@ComputerName

If your web server has a domain name like "www.mydomain.com", it will be:

us**@domain.com

Luke
Microsoft Online Support


Thanks a lot, Luke.

Vince C.
Jul 19 '05 #5

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

Similar topics

3
by: Marcin Gorzynski | last post by:
Hi Our partner is using our page in a frame. That couses a problem because our domain is unable to issue the cookie also session does not work. each time you click in the frame new session is...
2
by: Lee Wilkie | last post by:
Dear All, I'm new to ASP.NET and have been developing a small app at work to test Forms Authentication. When running on my development machine (using http://localhost/TestApp/Login.aspx for...
1
by: Joe Fallon | last post by:
I use forms authentication for my app. After I log in successfully each request by the browser contains 2 cookies. One for the SessionID and one for forms authentication which contains my ticket....
7
by: Marcus | last post by:
I know that when you start a session in PHP, the "cookie" it creates is not the same as those that are stored in your browser's temp folder, and instead is kept in RAM. I am confused because in...
4
by: Gridlock | last post by:
I'm trying to read the cookies using HttpContext.Current.Request.Cookies, but the only cookie that I get is the ASP.NET SessionId cookie. There are many cookies on the machine, why am I only...
0
by: dawson | last post by:
I started off by trying to use the HttpCapabilitiesBase.Cookies Property (Note: This property is new in the .NET Framework version 2.0) however it kept on returning true even when I disabled...
4
by: surf_doggie | last post by:
I found that a number of my sites that send email using CDO failed withing the past 30 days. Consider the following. I know its not the best coding practice to open and close the connection so many...
3
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....
3
by: Will | last post by:
Is there a good article - or maybe a good chapter in a book - that someone can recommend on the topic of how to make cookie handling secure? I'm interested in common techniques for: -...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...
0
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,...

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.