src/Session.php
private static function rewriteCookieHeader($sameSiteRestriction = Cookie::SAME_SITE_RESTRICTION_LAX) {
		// get and remove the original cookie header set by PHP
		$originalCookieHeader = ResponseHeader::take('Set-Cookie', \session_name() . '=');

		// if a cookie header has been found
		if (isset($originalCookieHeader)) {
			// parse it into a cookie instance
			$parsedCookie = Cookie::parse($originalCookieHeader);

			// if the cookie has successfully been parsed
			if (isset($parsedCookie)) {
				// apply the supplied same-site restriction
				$parsedCookie->setSameSiteRestriction($sameSiteRestriction);
				// save the cookie
				$parsedCookie->save();
			}
		}
	}
private static function rewriteCookieHeader($sameSiteRestriction = Cookie::SAME_SITE_RESTRICTION_LAX) {
		// get and remove the original cookie header set by PHP
		$originalCookieHeader = ResponseHeader::take('Set-Cookie', \session_name() . '=');

		// if a cookie header has been found
		if (isset($originalCookieHeader)) {
			// parse it into a cookie instance
			$parsedCookie = Cookie::parse($originalCookieHeader);

			// if the cookie has successfully been parsed
			if (isset($parsedCookie)) {
				// apply the supplied same-site restriction
				$parsedCookie->setSameSiteRestriction($sameSiteRestriction);
				// save the cookie
				$parsedCookie->save();
			}
		}
	}
private static function rewriteCookieHeader ( $ sameSiteRestriction = Cookie :: SAME_SITE_RESTRICTION_LAX ) { // get and remove the original cookie header set by PHP $ originalCookieHeader = ResponseHeader :: take ( 'Set-Cookie' , \ session_name ( ) . '=' ) ; // if a cookie header has been found if ( isset ( $ originalCookieHeader ) ) { // parse it into a cookie instance $ parsedCookie = Cookie :: parse ( $ originalCookieHeader ) ; // if the cookie has successfully been parsed if ( isset ( $ parsedCookie ) ) { // apply the supplied same-site restriction $ parsedCookie -> setSameSiteRestriction ( $ sameSiteRestriction ) ; // save the cookie $ parsedCookie -> save ( ) ; } } }
Intercepts and rewrites the session cookie header

@param string|null $sameSiteRestriction indicates that the cookie should not be sent along with cross-site requests (either `null`, `Lax` or `Strict`)
Intercepts and rewrites the session cookie header