Whaaaaaaaaa? Why is that your only option? Can’t you just use a different template for your SSL pages?
Aha. I guess I should’ve been more clear. I meant that I didn’t think the site_url placeholder would work on a shared-SSL setup (although I haven’t actually tried it; it might work fine). The forms themselves should work fine. The only question I had was whether you’d get the right action URL in the form if you use the site_url placeholder there, but you don’t have to do that so it’s not really an issue.
I guess I just need to figure out a way of testing a shared-SSL setup on my development server, and then working through the problems but using a seperate template for the SSL pages. Thanks!
Andy
OK I’ve tested the site_url placeholder on a shared-SSL page and it works fine. I wasn’t sure how that was set, so I was wary of using it. Looks like my wariness was unwarranted.
So all you have to do is to link to the page using the shared-SSL URL, include a <base href="[(site_url)]" /> tag in your document’s head, and make sure that your form’s action is correct.
Just don’t count on cookies or sessions from your non-SSL server...
-
☆ A M B ☆
- 24,524 Posts
You can pass the session_id in the GET or POST (using a hidden input field in a form, for example) then manipulate your sessions to copy the session data from the original session to the new one.
if(isset($_GET['s']) && $_GET['s'] != session_id()) {
$new_session = session_encode(); // save the new (current) session
$fname = session_save_path() . "/sess_" . $_GET['s']; // get the old session's file
if (session_decode(file_get_contents($fname))) { // get its data
$fields = $_SESSION['fields']; // store what you want in an array
}
session_decode($new_session); // restore the new session
$_SESSION['fields'] = $fields; // load in the array from the old session
}
The "fields" variable is just for example. Grab whatever values you want from the old session file.
Alternatively, you can just switch session files by setting your session_id to that of the old one passed in the GET or POST. This would only be suitable if your new session doesn’t have anything important in it.