Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
zorn-v opened this issue Feb 16, 2019 · 9 comments
Assignees

Comments

@zorn-v
Copy link

zorn-v commented Feb 16, 2019

Here

ini_set('session.use_cookies', 0);

@nao-pon nao-pon self-assigned this Feb 18, 2019
@nao-pon
Copy link
Member

nao-pon commented Feb 18, 2019

@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
Copy link
Author

zorn-v commented Feb 18, 2019

that problem exists only in apache2 SAPI

Nope, I get that error in php built in server

@nao-pon
Copy link
Member

nao-pon commented Feb 18, 2019

@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
Copy link

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
Copy link
Member

nao-pon commented Feb 18, 2019

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

Thanks! 👍

@MrAwanishKumar
Copy link

@nao-pon it's working now.

Thanks

@lianee
Copy link

lianee commented Jan 31, 2020

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 nao-pon reopened this Feb 1, 2020
@nao-pon nao-pon closed this as completed in 3099855 Feb 1, 2020
@nao-pon
Copy link
Member

nao-pon commented Feb 1, 2020

@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
Copy link

lianee commented Feb 1, 2020

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) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants