I can not retrieve the session variable using the following code
This is a file where requests are sent, I declare a session variable to use on another page that is called after the file is finished.
<?php
$parse_uri = explode( 'wp-content', $_SERVER['SCRIPT_FILENAME'] );
require_once( $parse_uri[0] . 'wp-load.php' );
$_SESSION["enviou"] = "true";
?>
On this other page, I try to recover as simply as possible
if ($_SESSION["enviou"] == "" || $_SESSION["enviou"] == null){
header("location:http://www.google.com.br");
}else{
$_SESSION["enviou"] == null;
}
But the variable is always empty, even if it is declared in the previous file.
When I enter the code session_start();
I get the following errors:
Warning: session_start() [function.session-start]: open(/var/lib/php-cgi/session/sess_6aqo4l2r50v2hguu8pnrqusvr7, O_RDWR) failed: No such file or directory (2) in /home/storage/a/6a/25/..../public_html/vl/wp-content/themes/....../page-formbarraresposta.php on line 2
Warning: Unknown: open(/var/lib/php-cgi/session/sess_6aqo4l2r50v2hguu8pnrqusvr7, O_RDWR) failed: No such file or directory (2) 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 (/var/lib/php-cgi/session) in Unknown on line 0
Can this be a server error? Since this same code has already been used in another project and has worked perfectly.