Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a subdomain delete a domain cookie?

Tags:

http

cookies

Suppose I have a cookie that is set for .domain.com, and my subdomain is sub.domain.com. Can I delete cookies that are set for the main domain? I know it is possible to read them, but is it possible to delete these cookies, or overwrite their values?

like image 499
Henley Avatar asked Jun 21 '13 19:06

Henley


1 Answers

Yes, a subdomain can set/expire a cookie for the main domain, but the main domain cannot set/expire a cookie for a subdomain. See RFC 6265 Sections 5.1.3, 5.3 (see point #6), and 8.6. Section 8.6 in particular describes how a subdomain can set a cookie for the main domain and have it affect a sibling subdomain.

like image 103
Remy Lebeau Avatar answered Oct 10 '22 12:10

Remy Lebeau