I Am using a session on a website and I am unable to take the data on the other page. I have used the code on other host and its working fine on other host so I think that the host problem.
The code I used to save the session is:
session_start();
$_SESSION["std_id"] = 'rst';
echo "<pre>";
print_r($_SESSION);
echo "</pre>";
And I am retrieving it on the other page with this code:
session_start();
echo "<pre>";
print_r($_SESSION);
echo "</pre>";
As I said its working fine on other host as well as on localhost, so that is the server issue, but I need to keep the login info of the user as we use to maintain login record through session.
We have installed Joomla on that site and its working fine its maintaining all the login info and every thing.
Can anyone suggest me the solution other than changing the host 🙂
Thanks.
Edited:
I can’t show the host name as due to some reason.
The domain I am using is a sub-domain for a University department and the main site is of University site, and I am using this code under a new folder at sub domain.
do you get any errors in your error log or in php error reporting (error_reporting)?
like
"No session exists - writing to test_value"you can also test your current session directory if its writeable:
one solution is to
change your session directorywith this:(create the /tmp directory
by handin your root)or to your .htaccess
and give
0777permission in that /tmp directory, which must be in your root.