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

[FEATURE] Destroy session at the end of the cron job files #1528

Open
allandanton opened this issue Jun 11, 2023 · 0 comments
Open

[FEATURE] Destroy session at the end of the cron job files #1528

allandanton opened this issue Jun 11, 2023 · 0 comments

Comments

@allandanton
Copy link
Contributor

Is your feature request related to a problem? Please describe.
ocsreports keeps the mysql object in the $_SESSION superglobal variable. For a cronjob like the cron_wol.php keeping some data in a session for the next run ist not needed so do a proper cleanup and destroy the session at the end of the file. At the moment on every run of one of the cronjobs a new session file ist saved that is not needed in the future anymore.

Describe the solution you'd like
Add two lines at the end of every cron_*.php file to destroy the session after the script has done its work:
$_SESSION = array(); session_destroy();

Describe alternatives you've considered
An alternative would be to not save the MySQL object in the session but in a normal global variable that that can be used in every function by the global keyword. This would keep the session generally cleaner but will have some bigger reworking of the code to do. My first solution would be a quick and easy fix.

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