hch
hch

Reputation: 6430

Set path of cookie to arbitrary path

I know that URLs can only set cookie's domain field to be a domain-suffix of the current domain. e.g. www.example.com can set the domain field to www.example.com or .example.com. However, I am not that sure about limitations on the path field. Suppose my URL is www.example.com/subdir1, what paths could I set? Could I set a cookie with path set to "/"? Could I set a cookie with path set to "/subdir2"? I have googled around. There is much discussion on the domain field but not the path field.

Upvotes: 1

Views: 82

Answers (1)

Chonghao
Chonghao

Reputation: 98

The path could be set to anything.

Upvotes: 2

Related Questions