0

I have a domain www.example.com with two sub domains

foo.example.com
bar.example.com

I want to set a cookie for all subdomains except foo.example.com , Any help is greatly appreciated!!

Currently I have tried,

<cfcookie name="cookieName" value="cookieValue" expires="never" domain=".example.com" path="/">

But it sets this cookie on all sub-domains.

Adil Malik
  • 6,279
  • 7
  • 48
  • 77
Irfan Ahmed
  • 9,136
  • 8
  • 33
  • 54

1 Answers1

0

If I understand your question correctly, you wish for a cookie set on foo.example.com to be read by both foo.example.com and example.com but not by bar.example.com. I don't think you can do this - at least not using the native application of domain cookies. The domain cookies allow a cookie set in a parent to be read by subsequent children. Since foo and bar are both children of example.com in the heirarchy, they would be able to read a domain wide cookie.

Mark A Kruger
  • 7,183
  • 20
  • 21