I am using the codeigniter tank auth library for working with users and it has been working great. Whenever I try to access any controller, the function checks if the user is logged in like this:
if($this->tank_auth->is_logged_in()) {
If it's logged, I load the model but if not, I do a redirect to the login page. It has been working like this for one month but now I'm extending my application and built some other controllers that uses the same technique but the files are located in other folder. The previous working application still works great but in this app from the new folder (it's basically a new module for that application, uses the same login page but redirects differently according to user selection of the module) I can login correctly, I can make a any request to the controller with no problems but at some point, it tells me the user is not logged in. It's not the session expired or something, it's like I'm making one request now, extending my session and the next at 3 seconds interval gets the user logged out...I've done nothing different with my new controllers, but still, after a while, sometimes it takes 5 minutes, sometimes 15 minutes, it logs out...I don't know why, is something messing with my session ? I don't use session for anything else...
Anybody knows what this is about ? Or any suggestion ? I can give further details if requested.
Thank you very much.
EDIT: The new module consists in more controllers in the same Codeigniter instalation, it works with the same CI config, same tank auth library and the functions are copied to the main requests controller like this:
class Requests extends Controller
{
function __construct()
{
parent::__construct();
$this->load->helper(array('form', 'url'));
$this->load->helper('date');
$this->load->library('form_validation');
$this->load->library('tank_auth');
}
..............
more functions
..............
function getServices() { /// One of the functions that the new module uses
if (!$this->tank_auth->is_logged_in()) {
return;
} else {
$this->load->model('requests/getServices');
$data['tid'] = $_POST['tid'];
$this->getServices->showData($data);
}
}