Forum Moderators: coopster
I'm currently working on a site where the hosting provider I have to use has separate SSL server i.e. the site is on www.mydomain.com but any secure stuff has to be on www.secure.hostingcompany.com/mydomain.com/
So I write a load of login / registration scripts which all work fine EXCEPT when you log in on the secure server and your session cookie is set this is not recognised when you're sent back to the main site, because it's a different domain.
I'm sure this is not an uncommon problem. Any ideas about what the best way to tackle this would be? The solution needs to be simple and more importantly SECURE.
Any help greatly appreciated.
Our login page is on the secure server as well as all member section stuff. When they swap over to the public site, which is still accessible through the menu, none of the info in the session is accessible therefore we don't use it.
We maintain a different session on the public site but it is mainly for referrers so it isn't really used except when people sign up.
A summary of the current contents of the shopping cart will be shown on every page. A session is required to identify the user. It's a permanent cart that will stay open for several months or until the customer finally closes the sale, which is why a login is required. The session id needs to be available to every page - but without passing it in the URL.
I'm waiting for a response from the hosting company to see if they can arrange [mydomain.com...] which will solve all my headaches.
A shopping cart I have uses this type of thing - basket sessions are stored in the database, with a table for BasketItems, which relate to the basket session.
Without going in to too much depth - but just a thought.
Maybe this is how you're doing it and I am just completely missing the plot ;)
Regards,
wruk999
wruk999 - I'm starting to think along these lines. I'd probably need to store things like the currently selected language and currency in the DB too. A bit of a pain though when PHP sessions are usually so easy to use.
Anyway I'm working on a pretty good workaround at the moment. Thanks for all your input.
This would be possible like this:
[nonsecuredom.com...]
[securedom.com...]
And then just call via a $HTTP_GET_VARS['id']
These would still need to be centrally stored, and the best way for that is via database.
The other problem is that the session id _could_ be tampered with. Not saying it will - but could be ;)