Skip to content

DefaultCookieSerializer.setCookiePath missing @Nullable on cookiePath parameter #3883

Closed

Description

@terussell85

Describe the bug
DefaultCookieSerializer.setCookiePath doesn't accept null values.

This is in version 4.1.0.

setCookiePath is the setter for the cookiePath field, which is annotated with @Nullable, but it doesn't accept null values due to the missing annotation.

The setter documentation specifically calls out nullable values, so it is considered a valid value, but the setter input parameter doesn't mark it as @Nullable. Therefore passing null breaks in Kotlin 2.3.1 (likely in anything >= Kotlin 2.1).

To Reproduce

class CustomCookieSerializer: DefaultCookieSerializer() {
    override fun writeCookieValue(cookieValue: CookieSerializer.CookieValue) {
        setCookiePath(null)
    }
}

Expected behavior
Able to call setCookiePath(null) without compilation errors

Activity

  1. added
    type: bug
    status: waiting-for-triage
    on Jul 31, 2026
  2. self-assigned this
    on Sep 14, 2026
  3. added and removed
    status: waiting-for-triage
    on Sep 14, 2026
  4. added 2 commits that reference this issue on Sep 15, 2026
    8438755
    0ef13d0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: coretype: bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions