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

Rudashi's avatar

Session lifetime on remember_token

Hi, I have a question. How I can extend lifetime session to time expire remember_token?

0 likes
9 replies
Rudashi's avatar

If I added something to session like this:

$request->session()->put('intro', $model);

the recrod is deleted after time in config file (120 minutes in default). Is this normal? Beacuse I want the same lifetime like remeber_token.

mikefolsom's avatar

I don't understand what you are trying to accomplish. If you don't want to allow for a login to exceed the session, just don't offer "remember me" as an option. If you are looking to extend intro's lifetime beyond the session, you'll need to use cookies to store the value, or add it to persistent storage (i.e. database).

Snapey's avatar

You are talking about the session lifetime, not the remember me token.

This is configured in /config/session.php look for lifetime

Don't be tempted to set this to a high number if you expect a lot of users.

Rudashi's avatar

@mikefolsom I want to extend intro lifetime just like "remember me" if User use this feature. That's my goal. If I understand you correctly I need use cookie or database to achieve this.

Snapey's avatar

I've no idea what intro lifetime is ?

What business problem are you trying to achieve?

Rudashi's avatar

I need to store additional information when user is authenticated. I used to this session (which lifetime is default 120). If user useremember me this extra data in session expire after that time.

Snapey's avatar
Snapey
Best Answer
Level 122

remember me only avoids filling in the login page. It does not preserve the session.

default lifetime is 120 (minutes) if the user does not submit an additional request in this time then the session is lost, and will be garbage collected at some point.

2 likes
JerryM2's avatar

how can i change remember_me token expire time to 10 days

Please or to participate in this conversation.