Studio-42 / elFinder

📁 Open-source file manager for web, written in JavaScript using jQuery and jQuery UI
https://studio-42.github.io/elFinder/
Other
4.64k stars 1.41k forks source link

Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time #2857

Closed zorn-v closed 4 years ago

zorn-v commented 5 years ago

Here https://github.com/Studio-42/elFinder/blob/b3a6555758656379c67e981a386c2fbc72507910/php/elFinderSession.php#L65

nao-pon commented 5 years ago

@zorn-v This is a measure for the problem of duplicate cookie being transmitted, but since that problem exists only in apache2 SAPI, it needs to be processed only for that environment. I will fix this.

Thanks! 👍

zorn-v commented 5 years ago

that problem exists only in apache2 SAPI

Nope, I get that error in php built in server

nao-pon commented 5 years ago

@zorn-v I'm sorry to be confused. What I would like to say is that "ini_set ('session.use_cookies', 0);' is required only for apache2 SAPI.

MrAwanishKumar commented 5 years ago

Hi, I am also getting the same error, running nginx web server.

PHP Warning 'yii\base\ErrorException' with message 'ini_set(): A session is active. You cannot change the session module's ini settings at this time' 

nao-pon commented 5 years ago

@zorn-v , @MrAwanishKumar I fixed it. Please try nightly build.

Thanks! 👍

MrAwanishKumar commented 5 years ago

@nao-pon it's working now.

Thanks

lianee commented 4 years ago

PHP 7.3, Apache 2.4.38, elFinder 2.1.53 display this warning. Perhaps you could check there is no active session before setting it to false, something like that: if (session_status()!=PHP_SESSION_ACTIVE) ini_set('session.use_cookies', 0);

nao-pon commented 4 years ago

@lianee I made this fix. In various environments, setting with ini_set () may be possible even after the session starts, so the modification has been made in consideration of such environments.

Thanks! 👍

lianee commented 4 years ago

Thanks, unfortunately, this doesn't fix the issue when a session is active in this environment (classic debian LAMP) and session.use_cookies is true (the default, and the desired state for me).

Well, that's no big case since it's just a warning, but I like to have error reporting, and it bothers me to have this one every action in elFinder.

Do you think just ignoring this warning would cause problems?, as in: if (@ini_set('session.use_cookies', 0) === false) {