$config */ protected function newCookie($request, $config): Cookie { return new Cookie( self::cookieName(), $request->session()->token(), $this->availableAt(60 * $config['lifetime']), $config['path'], $config['domain'], $config['secure'], false, false, $config['same_site'] ?? null, $config['partitioned'] ?? false ); } /** * Shared with the Blade layout, which tells the frontend which cookie * to read — there is nothing on the client that could derive this. */ public static function cookieName(): string { $name = config('session.xsrf_cookie'); return is_string($name) && $name !== '' ? $name : 'XSRF-TOKEN'; } }