Page 1 of 1
sessions
Posted: Wed Aug 03, 2005 6:48 am
by junior
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
Posted: Wed Aug 03, 2005 8:19 am
by timvw
You should post it in the code section.
You can prepend the following to your code:
Code: Select all
ini_set('error_reporting', E_ALL);
ini_set('display_errors', TRUE);
I have a feeling that on one server there will be an error that session could not write to file...
Posted: Wed Aug 03, 2005 9:47 am
by imstupid
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.
Posted: Wed Aug 03, 2005 11:24 am
by timvw
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...)
Posted: Wed Aug 03, 2005 4:45 pm
by feyd
moved to PHP - Code..

Posted: Fri Aug 19, 2005 2:43 pm
by junior
Tim
I did that and got
Fatal error: Call to undefined function: session_start() ...file path
Thanks
Aouse
Posted: Fri Aug 19, 2005 3:22 pm
by junior
Ok
I've been told i need to enable 'session support'
Any one know how to do that?
Thanks
Junior
Posted: Sun Aug 21, 2005 7:24 am
by junior
Ok
My web hoster managed to enable sessions in the php installation
Thanks guys
Junior