Explanation . This answer concerns the use of php.ini files in the same folders that contain PHP files to overwrite system-wide default settings, this answer assumes that you already have a standard default php.ini file, settings of which you either cannot, or do not have to edit.
I had similar problems with what you are describing and it may hinder to assume that you do not have php.ini files in each active folder, whereas in reality there can only be ONE php. ini is in the root folder, and therefore any of the subfolders ( /students , etc.) does not use the php.ini root and just uses the default account or system.
Depending on which server system you configured (for example, CPanel install?), And then to change the default settings for the php.ini server, a new php.ini file containing only user settings (for example, in your data store for an account of a specific case) it is necessary to install in the directory each one where it is necessary to use the php.ini settings that are different from the default settings.
So, step by step:
Do you have php.ini in each folder, for example / , /teachers , /students , etc.?
Are all these php.ini files the same?
All folders should be the same, so everyone should have their own copy of php.ini or none of them should. Otherwise, such a change in behavior that causes inconsistency problems will occur when one (custom) php.ini parameter changes and the other (default) php.ini parameter.
If any folder doesnβt have them, or perhaps only your public html root folder has the php.ini , then this means that all other folders use the default value, and therefore the public html-root is looking for sessions in the wrong place - - It looks for the address '/home/mysite/cvsessions' , while the default address for PHP sessions is something like /home/tmp .
Does it help or is it good?
The best way to verify session start:
PHP> = 5.4
if (session_status() == PHP_SESSION_NONE) { session_start(); }
For PHP versions <5.4.0
if(session_id() == '') { session_start(); }
Source: fooobar.com/questions/18813 / ...
source share