Jump to content

http session -> https sessions


cmgmyr

Recommended Posts

Ok, i have a site that uses both http and https. I have the login on the http side and once I go to checkout items (in the https side) I get re-directed to the login page (which is supposed to happen when someone isn't logged on). I only get redirected in FF and Opera, IE works fine...go figure. Anyways...how can I use the same session information on both sides?

 

Thanks,

-Chris

Link to comment
Share on other sites

I tried to do this (which i don't know if its right)

$_SESSION['customers_id'] = $customers_id;   
$_SERVER['SSL_SESSION_ID'] = $customers_id; 

 

and this for my user checking

function getUser(){
	if(isset($_SESSION['customers_id'])) return $_SESSION['customers_id'];
	if(isset($_SERVER['SSL_SESSION_ID'])) return $_SERVER['SSL_SESSION_ID'];
}

 

It didn't work with this set up. Any ideas?

Link to comment
Share on other sites

Tbh I don't really use these session variables, however I wouldn't of thought by you changing the value would work because the server will generate the id each time the page is loaded (and not store the value you set). I'm thinking of storing both the general SID and the https SID, then check if strcmp($_SERVER['https'], 'on') == 0), if so I use the https SID, else I use the normal SID... dunno i'll tell you more next week when i've got to it.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.