Jump to content

Session values not passing to other pages


refiking

Recommended Posts

I have a script that was written and tested on another server, but now when I transferred it to the live server, session values are not being passed.  I made a couple test pages to check and confirmed that the only issue is the session variables.  Here is the test I performed.  Please tell me what I'm missing:

 

page1.php

<?

session_start();

$_SESSION['var1'] = 'testing';

print_r($_SESSION);

?>

 

Returns:

Array ( [var1] => testing )

 

page2.php

<?

session_start();

print_r($_SESSION);

?>

Returns:

Array ()

Add the following three lines of code immediately after your first opening <?php tag on both pages, try again, and report any errors -

 

ini_set("display_startup_errors", "1");
ini_set("display_errors", "1");
error_reporting(-1);

Array ( [var1] => testing )

Warning: Unknown: open(C:\Windows\Temp\sess_akcd20pu86q7mvn2tdfahltja2, O_RDWR) failed: Permission denied (13) in Unknown on line 0

 

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (C:\Windows\Temp) in Unknown on line 0

 

How can I set the session folder to a directory that I create?

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.