laravel logout on session expire itsolutionstuff code example

Example 1: auto logout when session expires laravel

class AddLastSeenToUsersTable extends Migration
{
  public function up()
  {
    Schema::table('users', function (Blueprint $table) {
      $table->timestamp('last_seen_at')->nullable();
    });
  }
 
  public function down()
  {
    Schema::table('users', function (Blueprint $table) {
      $table->dropColumn('last_seen_at');
    });
  }
}

Example 2: auto logout when session expires laravel

# Session lifetime in minutes
SESSION_LIFETIME=10

Tags:

Misc Example