jetty / jetty/jetty.project

`HttpCookieUtils` ignores `expires` attribute

Open Beginner friendly
#15,718 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug
Dominant language
Java
Stars
4.1k
Forks
2k
Avg merge
3d 56m
Merged PRs (30d)
48

Description

Jetty version(s)
12.1.12

Jetty Environment
core

HTTP version
2

Java version/vendor
Java 26, Eclipse Adoptium

OS type/version
Ubuntu 24.04.4 LTS

Description
In HttpCookieUtils, both getRFC2965SetCookie and getRFC6265SetCookie ignore the expires attribute from the passed HttpCookie httpCookie parameter.

How to reproduce?

  1. Add a cookie, e.g. Response.addCookie(response, HttpCookie.build("name", "value").expires(Instant.now()).path("/").build());
  2. HttpCookieUtils generates a header value of name=value; Path=/

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with HttpCookieUtils, specifically getRFC2965SetCookie and getRFC6265SetCookie, then trace the cookie created through Response.addCookie. Reproduce the example with an expires value and inspect the generated header. Done means both header-generation paths preserve the expires attribute, with tests covering the resulting header values.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.