How to do give expire time to specific session in laravel 5.6 ?

105
August 14, 2018, at 7:20 PM

I want to create session and it should be remove at 3 days later.

How do I do that ? I checked out the documents and questions in here, but found nothing..

-what I want exactly ?

session()->put("suspect",true,strtotime($time_diff))

is that possible ?

Answer 1
$_SESSION['expire'] = time() + 259200; // 3 days
if(time() > $_SESSION['expire'])
{  
 session_unset();
 session_destroy(); 
}
Answer 2

in config/session.php edit

'lifetime' => 3 * (60 * 24), // 3 days
READ ALSO
WooCommerce AJAX Pagination no plugin

WooCommerce AJAX Pagination no plugin

I am trying to look into how I could create my own WooCommerce AJAX Pagination functionAll the tutorials I've found use a plugin and I would prefer not to

169
Prevent array_merge from merging an array if one of the specified argument is not an array

Prevent array_merge from merging an array if one of the specified argument is not an array

I want array_merge to merge only when the argument specified is an array else skip that argument

161
get hierarchy of users by parent

get hierarchy of users by parent

I am trying to get all child and grand child and their child in PHP

112
Get the top selling product's current inventory in mysql

Get the top selling product's current inventory in mysql

I want to get the top selling product's current inventory from the databaseI have successfully fetch the top-selling products but unable to fetch their current inventory in the same query

98