Session lifetime for Different Subdomains
I have 2 subdomains in a single Project, So Want to set different Lifetime for each of them..!! Is it Possible?
'lifetime' => 180, 'lifetime2' => 300,
Nope, you have to build this yourself!
@BOBBYBOUWMANN - Do you have any idea how to build or How Laravel Session will work for particular that thing?
You can use a middleware to set the session for a specific domain. Something like this:
public function handle($request, Closure $next)
{
$urlParts = explode('.', parse_url($request->url(), PHP_URL_HOST));
$subdomain = $urlParts[0];
if ($subdomain === 'my-custom-subdomain) {
Config::set('session.lifetime', 300);
}
return $next($request);
}
Please or to participate in this conversation.