The short version:
I've got a session cookie being set on a dev site but it's not being picked up when I move to the SSL (so the shopping cart empties when you go to the checkout).
When it's set on the www site:
# http://dev.domain.ext
Name devSID
Value 2e9f1b1f6ca718d0961d0257f3297c1a
Host .domain.ext
Path /
Secure No
Expires At End Of Session
And on the ssl side:
# https://dev.domain.ext
Name devSID
Value 6fe74ccc91b67bce46165d005bfd157e
Host .domain.ext
Path /
Secure No
Expires At End Of Session
It looks like the session cookie created under www isn't being picked up under the ssl side (conversely it doesn't go the other way either, if it's created on the ssl side it's not picked up on the www side).
Anyone got any bright ideas?
The long version (me working it through)
I've got a dev site currently on a dev sub-domain; the session cookie being set is accessible across the whole domain using a .domain.ext type format and is created using a PHP object which loads the parameters from a config table in the database.
The same object creates the cookie across all sub-domains so it's not creating duplicate cookies with different path values or anything like that.
Name devSID
Value [alpha-numeric hash value]
Host .domain.ext
Path /
Secure No
Expires At End Of Session
On my local machine the sub-domains used are www and ssl so the host string reads as .dev.local and the cookie is happily read across the entire domain (using Apache's https-vhosts.conf to setup the domains on the server and the Windows hosts file to point them to 127.0.0.1)... and everything is peachy.
However, when I upload it to an online dev server (with it's own config and vhosts settings) the cookie gets dropped when moving from the www to ssl sides of the site and I can't see any logical reason for it.
This is what's going on in vhosts:
<VirtualHost [IP ADDRESS]:80 >
ServerName www.dev.domain.ext
ServerAlias www.dev.domain.ext dev.domain.ext
...
</VirtualHost>
<VirtualHost [IP ADDRESS]:443 >
[SSL ENGINE BIT]
ServerName ssl.dev.domain.ext
ServerAlias ssl.dev.domain.ext dev.domain.ext
...
</VirtualHost>
Technically the sub-domains (as defined by ServerName) are www.dev and ssl.dev however neither of those are actually registered with any DNS servers - the DNS servers just have the higher dev sub-domain registered; so I've added that into the ServerAlias list and entries have been made in my Windows hosts file so the unregistered sub-domains resolve on my machine.
[IP ADDRESS] www.dev.domain.ext
[IP ADDRESS] ssl.dev.domain.ext
And the session cookie parameters:
Name devSID
Value [alpha-numeric hash value]
Host .domain.ext
Path /
Secure No
Expires At End Of Session
So theoretically that cookie should be accessible across all sub-domains (even the live site actually since I've not limited it to the dev sub-domain) but whenever I move to the SSL side the cookie gets dropped.