Page 1 of 1

passing session details to https//

Posted: Wed Nov 26, 2003 10:05 am
by garyfear
Good day everybody

I have a site hosted with an ISP that has a general SSL server but it is a different domain to the site I'm working on. To give you an example using dummy names.......

the site is at http://www.mynewphpsite.co.uk

when I have to use the secure server, I have to pass the user to:

https://sslusers.com/mynewphpsite/index.php

The site I have prepared uses session cookies only and is there a way I can pass this cookie to the https section even though it is under a different domain.

I hope someone may be able to help and if so, thanks for taking the time to read this.

Gary Fear

Posted: Wed Nov 26, 2003 12:04 pm
by Weirdan
I'd suggest the following hack:

Code: Select all

<?php
  list($sess_name,$sess_id)=explode("=",SID);
 //closing php tag here

<a href="https://sslusers.com/mynewphpsite/index.php?session_transfer=<?=$sess_id; їand here] ">Click here to go to secure server</a>
index.php:

Code: Select all

if(isset($_GET["session_transfer"]))
  session_id($_GET["session_transfer"]);
session_start();
[edit]
Forum drops closing php tags for some reason.
[/edit]
[one more edit]
It's simplest solution, but it isn't only one possible, I guess...
[/one more edit]

Thanks

Posted: Wed Nov 26, 2003 1:13 pm
by garyfear
Thanks ever so much...I'll try this and see how I go.

I appreciate your time in replying.

Gary Fear