Is order matter in Cookies?

J

jacksu

I have one application in two servers, two servers returns the same
cookie but with some elmenet in different order,

Set-cookie: a=abc; Path=/; Domain=.abc.com; Secure

another one is
Set-cookie: a=abc; Secure; Path=/ ;Domain=.abc.com

the later one will not be included in the Cookie list in the later
request. Does anyone knows whether the order of "secure" matter?

Thanks.

Here is the definition copied from RFC 2109.

set-cookie = "Set-Cookie:" cookies
cookies = 1#cookie
cookie = NAME "=" VALUE *(";" cookie-av)
NAME = attr
VALUE = value
cookie-av = "Comment" "=" value
| "Domain" "=" value
| "Max-Age" "=" value
| "Path" "=" value
| "Secure"
| "Version" "=" 1*DIGIT
 
J

Juan T. Llibre

The "standard" order is :
Set-Cookie: NAME=VALUE; expires=DATE;
path=PATH; domain=DOMAIN_NAME; secure

If you don't set an expires date, the cookie doesn't persist.

Why are you setting cookies like that, instead of using Response.Cookies ?
 
J

jacksu

It is not persistant cookie. We just used in the same session.

The questions is that if we put secure in the middle of cookie, then it
will not sent out by some software, like HttpUnit, but could be handled
by some browsers like IE and firefox.

Any suggestion?

Thanks.
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top