Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nizam0786's avatar

Delete session at expire

Hi Guys,

When a user logs in I do a check to see if they have multiple sessions in the browser if yes they get a pop up notifying them they are logged in on more than one device etc...

But the messages pops up most of the time because when a session expires it keeps the session in the table is there a way I can delete the session as soon as it expires?

thanks in advance.

regards,

Nizam

0 likes
1 reply
nizam0786's avatar

Setting expire on close in the config/session.php file to true seems to have done the job.

'expire_on_close' => true,

Please or to participate in this conversation.