Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Setting a cookie doesn't work when expires_at is not set #11

@mkosiedowski

Description

@mkosiedowski

I found an issue with cookie_manager.set method. It seems that when the expires_at parameter is not set in your Python code, it doesn't actually default to 720 minutes (as stated in the documentation), but in fact - the cookie is not set at all. That's due to this line in the frontend code:

"expires": new Date(expires) || new Date(new Date().getTime() + defaultExpiryMinutes * 60000),

The expression new Date(expires) always returns a Date object, even when the expires value is false, undefined, 0, null or an empty string. That's why this expression never falls back to the default value.

I would suggest changing that line to something like:

"expires": expires ? new Date(expires) : new Date(new Date().getTime() + defaultExpiryMinutes * 60000),

Until this bug is fixed, let everyone know that you should set the expires_at in your Python code (and pay close attention to the timezone - like mentioned in the example in the docs)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions