Jump to content

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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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