Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

PetroGromovo's avatar

How in laravel / vuejs / jwt to make time of session much bigger?

Hello, In my laravel 5.8 / "vue": "^2.5.17" / "vuex": "^3.1.0" / "tymon/jwt-auth": "^1.0.0" app I login into the system and current logged user is saved in localStorage with line like:

     localStorage.setItem("loggedUser", JSON.stringify(state.currentLoggedUser));

I want to make time of session much bigger, and I found option in my config/auth.php :

<?php

return [


    'defaults' => [
        'guard' => 'api',
        'passwords' => 'users',
    ],

    'guards' => [
        'web' => [
            'driver' => 'session',
            'provider' => 'users',
        ],

        'api' => [
            'driver' => 'jwt',
            'provider' => 'users',
            'hash' => false,
        ],
    ],

    'providers' => [
        'users' => [
            'driver' => 'eloquent',
            'model' => App\User::class,
        ],

    ],


    'passwords' => [
        'users' => [
            'provider' => 'users',
            'table' => 'password_resets',
            'expire' => 460, // I modified this option !
        ],
    ],

];

But as I see that does not help, and seems tine of my session expired is rather short, withing 1 hour. Are there some other config options to make time of session much bigger ?

Thanks!

0 likes
1 reply

Please or to participate in this conversation.