Hi
I'm new to this forum so sorry if this post should be in a different disscussion.
I am having problems using sessions in php. The code i have written works on one host but on another it does'nt work!!!
the code is:
<?php
session_start();
$_SESSION['sess_var'] = "Hello world!";
echo 'The content of $_SESSION[\'sess_var\'] is ' .$_SESSION['sess_var'].'<br />';
?>
both servers are running PHP 4.4.0
Thanks
junior
sessions
Moderator: General Moderators
You should post it in the code section.
You can prepend the following to your code:
I have a feeling that on one server there will be an error that session could not write to file...
You can prepend the following to your code:
Code: Select all
ini_set('error_reporting', E_ALL);
ini_set('display_errors', TRUE);hey-
i'm having the exact same problem. tim- what's the next step... I've got the "session could not write to file" error message, and
gives me Array()
thanks as always
man this combination of pollution and humidity is giving me headaches.
i'm having the exact same problem. tim- what's the next step... I've got the "session could not write to file" error message, and
Code: Select all
print_r($_SESSION );thanks as always
man this combination of pollution and humidity is giving me headaches.
This question has been asked many times before, so if you use the search button, copy the error message (remove the specified parts about your file) you should find the solutions pretty easily...
(Make sure the session.save_path exists, and that the users that is running php (typically www-data/nobody) has sufficient access rights...)
(Make sure the session.save_path exists, and that the users that is running php (typically www-data/nobody) has sufficient access rights...)