Skip to content
Snippets Groups Projects
Commit d4b2aa3e authored by Peter Rotich's avatar Peter Rotich
Browse files

Register session close on shutdown at the start of session handling

This is necessary to make sure session data is saved on redirect.
parent 9be06d36
No related branches found
No related tags found
No related merge requests found
......@@ -26,8 +26,12 @@ class osTicketSession {
if(!$this->ttl)
$this->ttl=SESSION_TTL;
// Set osTicket specific session name.
session_name('OSTSESSID');
// Forced cleanup on shutdown
register_shutdown_function('session_write_close');
if (OsticketConfig::getDBVersion())
return session_start();
......@@ -56,8 +60,6 @@ class osTicketSession {
array(&$this, 'destroy'),
array(&$this, 'gc')
);
//Forced cleanup.
register_shutdown_function('session_write_close');
//Start the session.
session_start();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment