Level 88
You can keep two sessions for example. One with the count of request and one with the original session. Then based on the that count you reuse the session or not
if ($request->session()->has('http_count') && $request->session()->get('http_count') > 0) {
$request->session()->set('http_count', $request->session()->get('http_count') - 1);
$request->session()->keep(['my_session']);
}
Note: This is the basic idea and I might have something wrong, I just did it out of my head on my phone :P
1 like