Level 41
You could set the global: SESSION_LIFETIME
vi .env
SESSION_LIFETIME=3
Summer Sale! All accounts are 50% off this week.
I am making a mobile number verification using OTP module. I want to associate the OTP with the mobile number for 3 mins only and want to forget the key beyond 3 mins. How can I do so?
I am using the following snippet.
Session::put(['otp' => $otp, 'mobile' => $number]);
You cannot expire it (nothing is running to check if it has expired)
You can only save what time it was created and then realise that it was too long ago when you come to check it.
Please or to participate in this conversation.