stefangabos / Zebra_Session

A drop-in replacement for PHP's default session handler which stores session data in a MySQL database, providing better performance, better security and protection against session fixation and session hijacking
https://stefangabos.github.io/Zebra_Session/Zebra_Session/Zebra_Session.html
Other
172 stars 85 forks source link

After the server session times out, it takes 60 seconds to return to login #55

Closed s681562 closed 2 weeks ago

s681562 commented 2 months ago

If a session timeout (401) occurs overnight and I return to the "Home" page, I have to wait 60 seconds.

How to avoid this?

Which setup would be recommended?

@version 4.1.0 (last revision: June 18, 2024)

public function __construct(
        &$link,
        $security_code,
        $session_lifetime = 0,
        $lock_to_user_agent = true,
        $lock_to_ip = false,
        $lock_timeout = 60,
        $table_name = 'session',
        $start_session = true,
        $read_only = false
) {

Today after start working:

KakaoTalk_20240725_092330376

Today in mariadb-slow.log as last entry:

SET timestamp=1721649996;
SELECT GET_LOCK('session_59f1b4150022ec50dd8c959ce66d27785603cc6e', '60');
# Time: 240724 21:21:28
# User@Host: root[root] @ localhost []
# Thread_id: 11332519  Schema: mrs  QC_hit: No
# Query_time: 15.561031  Lock_time: 0.000000  Rows_sent: 1  Rows_examined: 0
# Rows_affected: 0  Bytes_sent: 121
SET timestamp=1721823688;
SELECT GET_LOCK('session_f2f58006fea9f1a991271f6a7d7bdd805dc5ed8a', '60');
stefangabos commented 2 months ago

Make sure you are using the very latest version. I did an update regarding this. See more here

s681562 commented 2 months ago

Yes, it is already included in the new version 4.1.0. I can't explain why this happens. I noticed a long reload time of the homepage after the session timeout when the user clicked the home button, which matches the 60 seconds in $lock_timeout. So I'm still curious for a good idea.

stefangabos commented 1 month ago

hey, did you manage anything with this issue or is it still happening?