Welcome Guest, Not a member yet? Register   Sign In
Session data lost after redirect randomly (CI4.1.5)
#17

(06-30-2023, 06:57 PM)kenjis Wrote:
(09-27-2022, 04:16 AM)pJenkiss Wrote: When I refresh the same page (without login), every few seconds a new record is added to "ci_sessions" table.

Note: not every refresh creates new record, it happens randomly. Sometimes it creates it every refresh, sometimes it's the same for minute or so (random time, random amount of refreshes)

The behavior seems to be very strange.

There should be one record for one valid session, and the primary key constraint in the session table
(https://codeigniter4.github.io/CodeIgnit...rimary-key)
should assure that there is only one record.
Records are unique - each new record has a different key. It seemed like session would be turned off in the browser, but it can't be true. Table' keys are correct. Anyway, that's not a big issue anymore - I manually turned off session in our public pages because that caused a crazy growth of sessions table (that was our biggest concern). Right now the growth slowed down because we use session for internal users only, but another issue exist - the session randomly shuts down and users randomly get kicked-off from the site. I'm unable to replicate when exactly it happens - it's always on different page, can't catch any pattern. That's why this issue is so confusing to me, I have no idea what to do and appears nobody on this forum can help as well. 

PS: for example, this is sessions table locally, I logged in to the system and opened 7 pages, made some page refreshes. 3 records appeared - checked after each click - sometimes only timestamp changes, and sometimes new records is created. All pages are the same "type": loading page + load extra data with jQuery (as I mentioned earlier - X-Requested-With header is added for those).
[Image: ci-session.jpg]
Reply


Messages In This Thread
RE: Session data lost after redirect randomly (CI4.1.5) - by pJenkiss - 07-02-2023, 05:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB