I currently have a problem with my laravel(4.2) app.
I want to update my database when the user is offline by the end of session (Automatic).
So I put the lifetime session to 1 minute for testing.
I create an event file :
<?php
Event::listen('auth.login', function($user)
{
$user->is_online = 1;
$user->save();
});
Event::listen('auth.logout', function($user)
{
$user->is_online = 0;
$user->save();
});
Everything works perfectly when I log in or log out manually but when I get automatically disconnected by the end of the session it does not work.
If you have an idea I would appreciate
Thanks.