Codeigniter Session data lost on the third navigation - codeigniter

This is a really strange problem. I have an application that I build using Codeigniter 3, HMVC, and Ion Auth. It was working well until I migrated it from one server to another. Now the data in the session is cleared after 3 navigations.
I tested it by logging into the application and watching the data field in the ci_session table as I navigated. I made it as simple as possible. I perform a browser refresh from the view I reach after login. On the third refresh, the data disappears from the database for my session and the application sends me back to the login page (application checks to see if the user is logged in). I even waited awhile (less than the 7200) to see if it was a time out and the time between refreshes does not seem to matter. I did not add code, because I do not know what code would help.
Does anyone have an idea what setting may be the cause?

Some time Codeigniter Session not working it has problem with PHP version
Change Your Server PHP Version.

Related

How to refresh time (Carbon) every 1 second in Laravel?

I am creating a cms app where a user can post their own, of course!
The problem I am facing is when using Carbon. I am using Carbon to make the created_at readable to humans using diffForHumans(). However, the time updates only when I refresh the page.
How can I dynamically refresh the time (Carbon) without having to refresh the page?
Carbon is a PHP package, and PHP renders your templates into HTML/CSS only once as a response when the user requests for a particular page.
What you're looking for instead is to implement this counter in Javascript. Javascript actually runs on the client's browser, whereas PHP is only run on the server itself.

Forcing a logoff from a Joomla admin session

In Joomla! 3.6, we're trying to force a user to the login screen from the admin section if their session has expired, but without any user input. By default, Joomla! will send people to the login screen if they attempt to load a page after their session has expired. This is something we want automated so if someone walks away and forgets to lock their system, the current page(s) can't be accessed if the session times out.
My initial attempt around this was to run a timed JS loop in administrator\index.php and have it make an AJAX call to an external PHP file that could query the session table. However, including jQuery at such a high level causes many other references to break due to it being included more than once. Due to how the default redirect action works, all this really needs to do is force a page refresh.
Is there a better way or location to do this without breaking existing code?
This required two things to fix.
1) Add
// jQuery needed by template.js
JHtml::_('jquery.framework');
2) Change $.ajax to jQuery.ajax

Apache Wicket Session Timeout; Logging back in and returning to the page

I'm not sure how to implement this and I'm quite new to Wicket, but the behavior I'm trying to aim for is; when a session timeout occurs, the User is redirected to the login page to relog, when he relogs, he is then redirected to the page he was viewing before.
Any help is appreciated.
The functionality you want only works when the server can identify which page you want to act on. So only stateless form submissions, and bookmarkable URLs will do this. Wicket does this out of the box, but only in the stateless/bookmarkable variations.
Wicket stores the page information (sort of) in the session. When the session has expired this information is no longer available. Then only requests that are not relative to the session/require information that used to be in the session will have the desired effect.
Have you tried the following code in your WebApplication.init() method?
IApplicationSettings asSettings = getApplicationSettings();
asSettings.setPageExpiredErrorPage(PageErrorSessionExpired.class);
Substitute your own WebPage class for my PageErrorSessionExpired here.

codeigniter loses session due to redirect, is there a way to regenerate it?

I've got a form that has, among other things, a preview button and a submit button. Let's say that the form contains a person's data. Clicking preview will submit the form to example.com/preview and get it opened in a new tab. The preview controller will insert the person's data in a table and, based on the value of LAST_INSERT_ID(), it will redirect to example.com/person/ID. When the redirect occurs, all session data is lost. I want to be able to keep session data so that, upon checking the example.com/person/ID page, the admin user can close it and do some changes to the form or submit it.
I've noticed that storing the session id in a flashdata item won't work, it won't get past the redirect. Also, if i somehow manage to get the session_id past the redirect (although adding it to the url is not what my client wants), I still don't know a way to regenerate the Codeigniter session with it. Another option I've looked into is using Codeigniter Native Session class, but the version I've found on the site is not for Codeigniter 2.0.0.3, and I'm afraid that using it might break something.
Any advice is much appreciated.
The solution was to change my ci_sessions database table fields' collations to utf8_general_ci (the default was latin1_swedish_ci)

Kohana + Safari + Resource tracking causes my session keys to reset

I have a number of sites using Kohana's session handler set to use database sessions. Everything works fine until I turn on Resource Tracking in Safari's Web Inspector. After enabling resource tracking, the page refreshes (normal), but then if I refresh the page twice I get logged out. From what I can tell, the session id/key changes therefore it has no session. Upon watching the storage/cookies area, I can see the session id cookie change immediately.
I haven't been able to reproduce similar behaviour in any other browser, including Chrome (Webkit).
Any ideas what might be causing this?
This appears to be fixed in Safari 5.1, so in other words, no longer an issue. Still love to know why it was happening (in case there's another issue), but for now it's resolved.

Resources