Mojo::C...esponse(3)
πΈ NAME πΈ
Mojo::Cookie::Response β it's an HTTP response cookie, bestie π (and yes, this is the Mojo::Cookie::Response(3) page straight out of the User Contributed Perl Documentation, so you're in the right place π«Ά)
β¨ SYNOPSIS β¨
Like, the tiniest little taste of what this thing does π
use Mojo::Cookie::Response;
my $cookie = Mojo::Cookie::Response->new;
$cookie->name('foo');
$cookie->value('bar');
say "$cookie";
π DESCRIPTION π
Mojo::Cookie::Response is literally just a container for HTTP response cookies. That's the whole vibe β¨ It's based on RFC 6265 <https://tools.ietf.org/html/rfc6265> β no cap, that's the actual spec it follows π
π ATTRIBUTES π
Okay so Mojo::Cookie::Response inherits all its attributes from Mojo::Cookie, and then adds these new ones on top. Main character energy honestly π
π¦ domain
my $domain = $cookie->domain;
$cookie = $cookie->domain('localhost');
This is the cookie's domain. Where it lives. Its whole address, iykyk π
πΈ expires
my $expires = $cookie->expires;
$cookie = $cookie->expires(time + 60);
When the cookie expires β the expiration for the cookie. Rude but necessary π
β host_only
my $bool = $cookie->host_only;
$cookie = $cookie->host_only($bool);
The host-only flag, which indicates that the canonicalized request-host is identical to the cookie's domain. Big "same place, same energy" vibes π«Ά
π§ httponly
my $bool = $cookie->httponly;
$cookie = $cookie->httponly($bool);
The HttpOnly flag β and it can prevent client-side scripts from accessing this cookie. Protective queen behavior, we love her π₯
π max_age
my $max_age = $cookie->max_age;
$cookie = $cookie->max_age(60);
The max age for the cookie. Its little lifespan β³
π path
my $path = $cookie->path;
$cookie = $cookie->path('/test');
The cookie path. Where it's allowed to hang out π£οΈ
π samesite
my $samesite = $cookie->samesite;
$cookie = $cookie->samesite('Lax');
The SameSite value. That's it, that's the whole attribute π
π secure
my $bool = $cookie->secure;
$cookie = $cookie->secure($bool);
The Secure flag, which instructs browsers to only send this cookie over HTTPS connections. No insecure roads for this icon π
π METHODS π
Mojo::Cookie::Response inherits all its methods from Mojo::Cookie and then implements these new ones, periodt β¨
π¦ parse
my $cookies = Mojo::Cookie::Response->parse('f=b; path=/');
Parse cookies. Boom, cookies, parsed πͺ
πΈ to_string
my $str = $cookie->to_string;
Render cookie. Turn it into a string so it can go be a cookie somewhere π
π₯ SEE ALSO π₯
Mojoliciousβ the whole main quest πMojolicious::Guidesβ the reading material, do your homework bestie π- <https://mojolicious.org> β the website, go click around π
Okay that's the whole page, you ate that π
stay hydrated, stay canonicalized, and remember: this was perl v5.42.0, dated 2026-07-15 β mwah, love u, bye π«Άπβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Mojolicious 9.480.0-bp160.2.1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms