Jump to content

[SOLVED] Multiple Session problem


sunwukung

Recommended Posts

Hi

I'm having a problem with my sessions. When developing locally, my scripts work fine - but on the server they aren't passing the session data correctly. I'm having to use ini_set to save cookies in a specific directory on the host. When I move to the second script, using a header:Location protocol - it generates a new session that is empty.

 

In a nutshell:

 

//script1.........................

ini_set('session.save_path','./session/');
session_start();
$_SESSION['message'] = 'blah';

 

Then on another page

ini_set('session.save_path','./session/');
session_start();
if (isset($_SESSION['message'])
{
$msg = $_SESSION['message'];
echo "$msg";
}
else
{
echo "**** GRRRRRRR!!! AAAAAAAGHG!! the sessions still not working....";
}

 

I've taken a look at using session_name, but while I can figure out how to derive or retrieve a session_name (or session_id), I can't figure out how to force the second script to access the session I want.

 

Link to comment
https://forums.phpfreaks.com/topic/140227-solved-multiple-session-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.