3

Very simple question here. Knowing about cross domain cookie security, does the same apply to sub domains?

EG. Should I be able to read a cookie set on some.abc123.com from the sub domain of www.abc123.com?

Strontium_99
  • 1,539
  • 6
  • 29
  • 49

2 Answers2

5

Cookie domains are suffix matching, so cookies of www.abc123.com will not be sent on the site of some.abc123.com and visa versa.

To have cookies be sent on both domains you should use .abc123.com as the domain.

Ja͢ck
  • 161,074
  • 33
  • 239
  • 294
1

As an alternative set a cookie at the abc123.com level then set and read cookies from there.

see here Setting cookies for multiple sub-domains

Community
  • 1
  • 1
James
  • 97
  • 8