i have a domain for example : example.com
and i have sub-domain : sub.example.com
the users on the site is sharing the same session & cookies,
but how can i remove cookies from both the domains ?
for now i delete from one domain and when the goes the the sub-domain he is logged in again ..
much thanks. shlomi
You can delete a cookie by setting it’s expiration date to a datetime that has already been passed. You can do the same for a subdomain.
To clarify, the path is the path relative to the main domain. You “sub” should be a folder inside the main domain.
sub.example.comis in fact something like exampleRoot/sub/ so this is the Path you put to your cookie and you set the datetime to an old datetime to remove the cookie from this subdomain.