I have an application that has user management using sessions.Under the root folder of the application I have an admin panel which I need to have different session as otherwise it conflicts with the root session.
-root
-admin/adminFiles
-rootFiles
I went through this thread and also the docs and tried the below code in my admin folder
if(HTTP_SERVER != 'http://localhost'){
session_save_path("/tmp");
}
session_name('session_for_admin');
ini_set('session.cookie_path','/session_for_admin');
session_set_cookie_params(60*60*24*5,'session_for_admin');
session_start();
This just does not start the session.No error in the logs too. What am I doing wrong here.
I want to do it this way because the admin folder is just going to be accessed by a few privileged users and not very frequently. I am aware that session_name()
adds and overhead.But would like to get through it this way.