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

When PHP Session is set to autostart, an error can be reported as Cacti attempts to start it #3815

Closed
eschoeller opened this issue Sep 22, 2020 · 5 comments
Labels
bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@eschoeller
Copy link

I had previously upgraded from 1.2.9 to 1.2.11. Then I backed out. Now I've upgraded to 1.2.14. I'm getting a lot of these errors now:

2020-09-21 23:03:40 - ERROR PHP : A session had already been started - ignoring session_start() in file: /cacti/cacti-1.2.14-prod/lib/functions.php  on line: 5546
2020-09-21 23:03:40 - CMDPHP PHP ERROR NOTICE Backtrace:  (/graph_json.php[32]:include(), /include/auth.php[28]:require_once(), /include/global.php[439]:cacti_session_start(), /lib/functions.php[5546]:session_start(), CactiErrorHandler()

My php.ini :

date.timezone = America/Denver

; For Cacti spikekill
;memory_limit = 1024M      ; Maximum amount of memory a script may consume
memory_limit = 2048M      ; Maximum amount of memory a script may consume
max_execution_time = 90

; eric angry about files in /tmp
session.save_path = "/var/tmp/php_session_data"
;
; hide php version in http headers
expose_php = False

; 20190921 - schoelle - added to fix login problems for Cacti new install. 
; strange how this was missing for years and didn't really have problems?
[session]
session.auto_start=On

Cheers,

@eschoeller eschoeller added bug Undesired behaviour unverified Some days we don't have a clue labels Sep 22, 2020
@netniV
Copy link
Member

netniV commented Sep 23, 2020

I don't know who recommended the session autostart in the PHP.INI but that is your problem. I never use that and it's not something we recommend.

@eschoeller
Copy link
Author

I disabled the session autostart and the messages went away. So, that's good:) Maybe a check for that setting in the installer would be worthwhile. Dunno if it's worth the hassle though. I don't think it's on by default.

@TheWitness TheWitness changed the title Ignoring session_start() Issues with Cacti login when session_autostart is configured in php.ini Sep 29, 2020
TheWitness added a commit that referenced this issue Sep 29, 2020
Issues with Cacti login when session_autostart is configured in php.ini
@TheWitness TheWitness added this to the 1.2.15 milestone Sep 29, 2020
@TheWitness TheWitness added resolved A fixed issue and removed unverified Some days we don't have a clue labels Sep 29, 2020
@TheWitness
Copy link
Member

Fixed it.

@netniV
Copy link
Member

netniV commented Oct 6, 2020

Having autostart could conflict with the cookie options though, is that anything worth reporting on ?

@TheWitness
Copy link
Member

Correct, and good point. We should open a feature request to block it.

@netniV netniV changed the title Issues with Cacti login when session_autostart is configured in php.ini When PHP Session is set to autostart, an error can be reported as Cacti attempts to start it Nov 2, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Feb 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

3 participants