[PHP] Re: sessions vs domain problem

2006-12-22 Thread Colin Guthrie
Reinhart Viane wrote:
 I have the folowing problem :
 
 Hosting of my site is at http://www.groep6049.ksjnet.be
 http://www.groep6049.ksjnet.be/ 
 
 My domainname is www.ksachiropoelkapelle.be
 http://www.ksachiropoelkapelle.be/ 
 
  
 
 I have forwarded www.ksachiropoelkapelle.be
 http://www.ksachiropoelkapelle.be/  towards
 http://www.groep6049.ksjnet.be/index.php

I think this is because the browser thinks it is working with the domain
name www.ksachiropoelkapelle.be and the server thinks it is working with
 the domain name www.groep6049.ksjnet.be.

I also assume that the forwarding is based on Apache mod_rewrite rather
than a simple frame.

If you don't ever really want to access the uglier domain directly
(e.g. you are doing this to get free/cheap hosting) then you should be
able to tell PHP to use the correct domain for cookie paths using:
http://uk2.php.net/manual/en/function.session-set-cookie-params.php

Something like:

?php
session_set_cookie_params(0, '/', 'ksachiropoelkapelle.be');
session_start();
...


Hope that works for you.

Col.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: sessions vs domain problem

2006-12-22 Thread Reinhart Viane
Something like:

?php
session_set_cookie_params(0, '/', 'ksachiropoelkapelle.be');
session_start();
...


I inserted this code at the top:
session_set_cookie_params(0, '/', '.ksachiropoelkapelle.be');

It did not solve the problem, still after logging in on
www.ksachiropoelkapelle.be the session is not recognized.
I know the line of code works cause when I surf directly to
http://www.groep6049.ksjnet.be/ it does not work anymore (appearently the
cookie domain is not recognized anymore).

Any other ideas?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php