Hi,
I'm using sessions for user accounts. However, their login session is not sticking across pages if they switch from
domainname.com
to
www.domainname.com
is there a way to set this so sessions stick despite the addition (or subtraction) of the www?
Thanks!
Ahhh - I had that problem ages ago - you've got to set the cookie domain to .domain.com with just the dot in front to make it work on both. So before you start your session do:
session_set_cookie_params(0, '/', '.domain.com');
Thanks much Drakla! This is the case even if I'm not using cookies per se?
Uummm - I dunno! If it's using the sessid in the url then that shouldn't matter about the domain anyway, or is there something else going on, some arcane session magic we don't get in Wales?