Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cookies and domains problem ?

 
hasan khan
Ranch Hand
Posts: 223
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have 3 domains
http://www.mydomain.com
http://subdomain1.mydomain.com
http://subdomain2.mydomain.com

my servlet at http://subdomain1.mydomain.com is setting cookie like this

my servlets at http://www.mydomain.com is able to read the cookies set by http://subdomain1.mydomain.com but

servlets at http://subdomain2.mydomain.com is not able to read the cookie

please help
 
kapil munjal
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I have not experimented on this. But I feel that its like one interface and two classes implementing this interface.

Or One base class and two sub-classes.

I hope you got my point.

Accessing the resources of sub-classes by a reference of Super-classes is possible. But access the resources of a sister class is not possible.
 
Aruneesh Salhotra
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wonder if that is true. Cookie but its definition, should be readble from any URL from that domain. (.mydomain.com)
 
kapil munjal
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, I think its right because domain and subdomain are different and cookies should not have access to sister domains.

Only the Base domain should have access to all the cookies of sub-domains.
 
amit taneja
Ranch Hand
Posts: 813
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by kapil munjal:

Accessing the resources of sub-classes by a reference of Super-classes is possible. But access the resources of a sister class is not possible.


a resources of sub-class be acessed by reference of super class only if super class has such methods... only for overriding..

guys i am not able to understand this setDomain concept ?
how does it work ? please tell me more..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic