View Full Version : Session dying when moving from https to http

01-13-2010, 03:05 PM

I am creating a little ecommerce site which has a secure basket. The user can add the item/items to the basket and move to the checkout. The checkout transfers the user from the http to the https via a php header location. This works fine and the user can carry on and complete the order.

How ever if the user click a link thats not the checkout step two they are redirected to the http. This is also done with the header location. However once redirected and they are at http://sitename.com/page the the contents of the basket have been removed.

The session is only removed in IE. Firefox is fine.

Anyone one got any ideas as to what it could be.

Thank you


01-13-2010, 03:17 PM
Are you sure you're talking about SESSIONS, or do you mean "cookies"?

SESSIONS are cookies stored on the webhost server,
COOKIES are cookies stored on the user's PC.

They are different.

To hand-off SESSIONS, see this:

Let us know what you really mean.

01-13-2010, 03:46 PM
Its the session that gets lost on IE. i an print the contents before the redirect and the session is full of the basket. but after the redirect the session is empty.

01-13-2010, 03:56 PM
Take a look at the session_set_cookie_params() (http://uk2.php.net/manual/en/function.session-set-cookie-params.php) function. This should help you (particularly the http only part)