Welcome Guest, Not a member yet? Register   Sign In
site-wide cookies and subdomains issue
#1

[eluser]foetus[/eluser]
Hi,

I know there's a lot of post already with similar issues, but I haven't found anything that solve my problem yet.

so here is my problem:

I know that if I want cookies to be valid for all my subdomains I need to do this:
Code:
$config['cookie_domain']    = ".domain.com";

but the problem is that even after doing that, I still get domain.com as the cookie domain, so I get logged out when I move across domains. (domain.com, sub1.domain.com, etc).

So, what Am I doing wrong?
#2

[eluser]foetus[/eluser]
well, it seems that the problem is not codeigniter, I tried setting up the domain parameter manually and it still doesn't work.

I'm using a wild card, with modrewrite to simulate sub domains, so maybe this could be causing the problem. not sure tough...
#3

[eluser]foetus[/eluser]
I'm replying just to not leave this problem open, and maybe to help others xD (you never know Tongue).

so far, after several test, this is the conclusion I have come to:

for some reason browsers, seems to ignore cross-domain cookies for the domain I'm using: domain.do (.do it's a new domain for Dominican Republic). Chrome doesn't seems to be acepting cookies at all!!, at the start it wasn't even recognizing the domain name :S

I'm saying this because I tried running the same script on the same server, using 2 domains: 1 .com, 1 .do, and the result for the .com domain was successful (.domain.com), but for the .do domain, for some reason it goes converted to: domain.do (without the . at the beginig).

when I see the Http response using firebug for example, I do see: .domain.do, but on the cookies plugin (firecookie) I just see the domain, and the cookie doesn't work for the sub domains.

everything works ok on IE 9
#4

[eluser]Unknown[/eluser]
It basically can not work. A IE9 save the same cookies on domain.com and domain.do. Delete cookies and try again. If server 1 you can try to make the emulation of cookies in a text file. <a href="http://www.frcoupon.com">My help.</a>
#5

[eluser]foetus[/eluser]
I'm not using 2 domains for the same application, I'm just using domain.do, and some subdomains, like: sub1.domain.do, sub2.domain.do.

I used the .com domain, just to make a test on the server, it has nothing to do with domain.do




Theme © iAndrew 2016 - Forum software by © MyBB