For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > December 2006 > Same session in a second and third level domain









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Same session in a second and third level domain
Giacomo

2006-12-11, 7:01 pm

Hi everybody,
I have to domains,

www.domain.com
name.domain.com

I would like to share session between this two domains, but I was not
able to do this, even if I used "session.cookie_domain" feature.

Any suggestions?

Bye and thanks

--
Giacomo
Giacomo

2006-12-11, 7:01 pm

Giacomo ha scritto:
> Hi everybody,
> I have to domains,
>
> www.domain.com
> name.domain.com
>
> I would like to share session between this two domains, but I was not
> able to do this, even if I used "session.cookie_domain" feature.
>
> Any suggestions?


Nobody can help me?

--
Giacomo
Madkour

2006-12-11, 7:01 pm

HI Giacomo,
Can you post the relevent part of your code?
I'm not sure how you're using the "session.cookie_domain". Have you
used it with the cookie set params / get params functions?
You can also use the setcookie function. More information about it can
be found on "http://nl3.php.net/setcookie". There is a point written
about the exact issue you are discussing. It should be possible to use
the same session cookie among sub-domains. According to the information
in the above mentioned link, the absence of the '.' before the domain
name can cause some inconsistencies.

Good luck,

Madkour


Giacomo wrote:
> Giacomo ha scritto:
>
> Nobody can help me?
>
> --
> Giacomo


Giacomo

2006-12-11, 7:01 pm

Madkour ha scritto:
> HI Giacomo,
> Can you post the relevent part of your code?
> I'm not sure how you're using the "session.cookie_domain". Have you
> used it with the cookie set params / get params functions?
> You can also use the setcookie function. More information about it can
> be found on "http://nl3.php.net/setcookie". There is a point written
> about the exact issue you are discussing. It should be possible to use
> the same session cookie among sub-domains. According to the information
> in the above mentioned link, the absence of the '.' before the domain
> name can cause some inconsistencies.


Thanks a lot, I solved it with this code before session_start:

session_set_cookie_params(0 , '', '.mydomain.it');

Thanks again...=)

--
Giacomo
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com