Loosin session id over SSL

211 Views Asked by At

im trying to send a session of data over a shared SSL.

to load my session i have the following at the top of my core file:

print_r($_COOKIE);
if ( isset( $_POST["PHPSESSID"] ) ) {
    session_id( $_POST["PHPSESSID"] );
}elseif( isset( $_COOKIE['PHPSESSID'] ) ) {
    session_id( $_COOKIE["PHPSESSID"] );
}
session_start();

on the non SSL view it prints a differrent id to the one over the SSL. Whene i go back and forth the ids are not changing just 2 seperate ones for the shared SSL and the non SSL. How can I change the script to have one over both?

1

There are 1 best solutions below

2
On

Use the function session_set_cookie_params() and set $secure = false

Reference: http://www.php.net/manual/en/function.session-set-cookie-params.php