Jump to content

Using Specific Sessions


sunwukung

Recommended Posts

HiI'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
Share on other sites

Archived

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

×
×
  • Create New...