(problem php session, session path , session.save_path)
Few days ago i shifted few of my site to new server, Soon we found that the user cannot login to the site. After searching the problem i found that the temporary directory that save the session file is not writable .
To fine if the current session is writable or not :
Below code will return you the current session path -
Or you can change the path in php.ini file the value of
Few days ago i shifted few of my site to new server, Soon we found that the user cannot login to the site. After searching the problem i found that the temporary directory that save the session file is not writable .
To fine if the current session is writable or not :
Below code will return you the current session path -
ini_get("session.save_path");
Below code will return true or false, if the directory is writable the true else false-
is_writable(ini_get("session.save_path"))
if the current session save path is not writable the make it writable if that is not possible the change the path like ini_set("session.save_path","/tmp");
This code should place before session_start();
Or you can change the path in php.ini file the value of
session.save_path
PHP : Session write problem
Comments
Post a Comment