Page 1 of 1

Sessions and W3C standards compliance

Posted: Thu Nov 27, 2003 5:57 pm
by uberpolak
Here's the situation, I use session variables to remember which stylesheet a user has selected, and if no session already exists, the server adds "?PHPSESSID=(id)" to the ends of all my links. The problem occurs when the link already has a variable in it, and becomes something like this:

page.php?p=home&PHPSESSID=(id)

The "&" character is illegal in XHTML1.1, and this causes my pages not to validate. Does anybody know a way to change what the server inserts on the links?

Posted: Fri Nov 28, 2003 3:01 am
by twigletmac
There is a setting in the php.ini which governs what URL variable separators are. From a bit of digging on the site, this appears to be arg_separator:
http://php.net/manual/en/configuration. ... tor.output
There's a bit about it on this page (scroll down to the bit about 'Passing the Session ID'):
http://php.net/session

HTH,
Mac

Posted: Fri Nov 28, 2003 7:12 am
by niceguyeddie
I had the same problem and there are a couple of ways to go about it. The easiest is to do a htaccess, rather than hack your script, IMO.

Here's a useful tutorial that I have found:

http://martin.f2o.org/php/session