- Edited
Updated
I am getting the following DB error. DB Error #1062, Clients and Agents.
I understand that the session can not be created because it all ready exists and needs to be cleared. After I get this error, I find the session has now been cleared and the user can login.
Is there a way to clear these expired sessions automatically and avoid this error?
thank you,
Paul
Server Information
osTicket Version v1.15.6 (1a64b84) — Up to date
Web Server Software Apache
MySQL Version 8.0.28
PHP Version 7.4.3
OS Unbuntu 20.04 LTS
Error Log information
[Thu Apr 07 15:10:33.498138 2022] [php7:warn] [pid 383432] [client X.X.X.X:60080] PHP Warning: session_name(): Cannot change session name when session is active in /usr/share/osticket/include/class.ostsession.php on line 34, referer: https://mysite.site.com/scp/logs.php
[Thu Apr 07 15:10:33.498172 2022] [php7:warn] [pid 383432] [client X.X.X.X:60080] PHP Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in /usr/share/osticket/include/class.ostsession.php on line 40, referer: https://mysite.site.com/scp/logs.php
[Thu Apr 07 15:10:33.498185 2022] [php7:warn] [pid 383432] [client X.X.X.X:60080] PHP Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in /usr/share/osticket/include/class.ostsession.php on line 57, referer: https://mysite.site.com/scp/logs.php
[Thu Apr 07 15:10:33.498194 2022] [php7:warn] [pid 383432] [client X.X.X.X:60080] PHP Warning: session_set_save_handler(): Cannot change save handler when session is active in /usr/share/osticket/include/class.ostsession.php on line 82, referer: https://mysite.site.com/scp/logs.php
[INSERT INTO
ost_sessionSET
session_id= 'fb7knrkebem3lv9qc485do5qm2',
session_data= 'csrf|a:2:{s:5:\"token\";s:40:\"3b024deeafb4cb0b25787258f480553e8324d20b\";s:4:\"time\";i:1649267368;}_auth|a:1:{s:5:\"staff\";N;}',
session_expire= (NOW() + INTERVAL 86400 SECOND),
user_ip= 'x.x.x.x',
user_agent` = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36']
Duplicate entry 'fb7knrkebem3lv9qc485do5qm2' for key 'ost_session.PRIMARY'<br /> <br />
---- Backtrace ----<br />
#0 (root)/include/mysqli.php(201): osTicket->logDBError()<br />
#1 (root)/include/class.orm.php(3466): db_query()<br />
#2 (root)/include/class.orm.php(658): MySqlExecutor->execute()<br />
#3 (root)/include/class.ostsession.php(234): VerySimpleModel->save()<br />
#4 (root)/include/class.ostsession.php(159): DbSessionBackend->update()<br />
#5 [internal function]: SessionBackend->write()<br />
#6 [internal function]: session_write_close()<br />
#7 {main}
`