Welcome Guest, Not a member yet? Register   Sign In
Issue Tracking Sessions
#8

In CodeIgniter 4 (v4.2.12), to track when the session ID regenerates (every 300 seconds by default), you can manually compare the stored previous session ID with the current session ID on each request, just like tracking parcels with a umac tracking box; by saving the current session ID in the session itself (e.g., as
Code:
previous_session_id
) and checking if it differs from
Code:
session_id()
, you can detect a regeneration event, update your database with the new session ID, and maintain a correct user-session mapping without relying on IP addresses. This simple method ensures you can manage single logins, handle meaningful logout messages like "Session Expired" or "Multiple Logins Detected," and keep your sessions secure without needing to override CodeIgniter's core session handling. Let me know if you want an even cleaner
Code:
SessionObserver
class example!
Reply


Messages In This Thread
Issue Tracking Sessions - by 68thorby68 - 06-14-2023, 12:10 PM
RE: Issue Tracking Sessions - by kenjis - 06-14-2023, 01:26 PM
RE: Issue Tracking Sessions - by 68thorby68 - 06-15-2023, 02:21 AM
RE: Issue Tracking Sessions - by kenjis - 06-15-2023, 02:31 AM
RE: Issue Tracking Sessions - by 68thorby68 - 06-15-2023, 03:20 AM
RE: Issue Tracking Sessions - by kenjis - 06-15-2023, 04:40 AM
RE: Issue Tracking Sessions - by 68thorby68 - 06-15-2023, 09:46 AM
RE: Issue Tracking Sessions - by daniel_paul0 - 04-26-2025, 03:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB