I'm using Flexi auth and everything goes well until I use AJAX. With the user logged in, an AJAX request to a controller is done. This controller then uses a model to store some info to the database. When the user then goes to another page, he has been logged out.
At first I was trying to obtain the user id in the controller, but the is_logged_in function returned false. I thought the problem was using the Flexi auth library in the AJAX request, so I took out all Flexi auth code from the controller, but the user session continues to be closed.