We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The expires/max age for the cookie is
2022-02-25T03:18:25.063Z
$setCookie = SetCookie::create('lu2') ->withValue('aaaa') ->withExpires(new \DateTime('+5 years')) ->withMaxAge(500) ->rememberForever() ->withPath('/') ->withDomain('192.168.1.13') ->withSecure(false) ->withHttpOnly(true) ->withSameSite(SameSite::lax()); echo $setCookie; $response = FigResponseCookies::set($response, $setCookie); return $response->withStatus(201) ->withHeader("Content-Type", "application/json") ->write(json_encode($data, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
The text was updated successfully, but these errors were encountered:
When I run the same code, I get expires/max age:
lu2=aaaa; Domain=192.168.1.13; Path=/; Expires=Fri, 26 Feb 2027 20:55:46 GMT; Max-Age=500; HttpOnly; SameSite=Lax
What is the complete output you receive when you run that? Also, which version of PHP are you running? and what do you get if you run this?
echo (new \DateTime('+5 years'))->format('c')."\n";
For me, I see this:
2027-02-26T20:57:29+00:00
My PHP version:
PHP 8.1.3 (cli) (built: Feb 18 2022 09:32:50) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.3, Copyright (c) Zend Technologies with Zend OPcache v8.1.3, Copyright (c), by Zend Technologies
Sorry, something went wrong.
No branches or pull requests
The expires/max age for the cookie is
The text was updated successfully, but these errors were encountered: