Cookies delimiter in ASP.NET

C

Calvin Lai

Hi all,

I was developing an web application where the data in the client are stored
in cookies using the Response.Cookies collection. However, I have found out
that for some clients, their browser stored the cookies as name values pairs
with "." (Comma) instead of ";" (semi-colon) as delimiters! And this has
created a problem for the Request.Cookies collection because (I believe) the
microsoft cookies object has ";" as default delimiter. Does anyone how to
chage that? Thanks a lot.

Calvin
 
S

Shiv Kumar

The W3C specifications state that cookies are set using and http header like
so:
Set-Cookie: name1=value1; name2=value2; name3=value3

ASP.NET does it this way too. How do you see a comma instead of a semicolon?

Here is a sample http header

HTTP/1.1 200 OK
Server: Microsoft-IIS/5.1
Date: Sun, 18 Jan 2004 07:34:39 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Set-Cookie: firstName=Shiv; path=/
Set-Cookie: lastName=Kumar; path=/
Cache-Control: private
Content-Type: text/html; charset=utf-8
Content-Length: 782
 
C

Calvin Lai

The application I am developing is in fact WAP. It seems that some phone
models used "," instead of ";" as cookies delimiter in the phone wap
browser. Please help.

Calvin
 
S

Shiv Kumar

Well then they are not adhering to the specifications :)
I don't know if ASP.NET has a "parameter" for this. The only way I know you
could do this is by adding the Set-Cookie header yourself.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top