protected function initSession(Request $request)
{
// the name of the session cookie name.
$sessionName = $this->session->getName();
// if a session cookie exists, load the appropriate session ID.
if ($request->cookies->has($sessionName)) {
$this->session->setId($request->cookies->get($sessionName));
}
// in some rare cases you may want to force the session to start on
// every request.
if ($this->forceStart) {
$this->session->start();
}
}