Passing the session_id from non-secured to SSL page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
DudeBori82
Forum Commoner
Posts: 26
Joined: Thu Nov 18, 2004 10:09 am
Location: Florida

Passing the session_id from non-secured to SSL page

Post by DudeBori82 »

I am trying to continue a session from a non-secured page to a SSL shared certificate page. The session remains running on the previous pages, but when the pages are accessed through the SSL certificate (on the same server), the session has to be started all over and re-filled with the info. I am trying to pass a shopping cart with multiple items, and it could be very innefective to try POSTing the data.

Here's what I tried (and failed):

Page1:

Code: Select all

<?php
<input type="hidden" name="session" value="<? echo session_id(); ?>">
?>
Page2:

Code: Select all

<?php
session_start();
session_id($_POST['session']);
?>
If I use these codes, it doesn't give me any errors, but the info is not there
Post Reply