Answers for "how to set session time in laravel automatically logout"

PHP
2

set session after login with laravel

$user = Auth::User();
    Session::put('user', $user);
    $user=Session::get('user');
    return $user->name;
Posted by: Guest on October-20-2020
0

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');
    });
  }
}
Posted by: Guest on May-12-2021

Code answers related to "how to set session time in laravel automatically logout"

Browse Popular Code Answers by Language