Skip to content
This repository has been archived by the owner on Nov 3, 2020. It is now read-only.

Cookie expiry set fails when set to decimal #441

Open
santiago-su opened this issue Sep 2, 2020 · 1 comment
Open

Cookie expiry set fails when set to decimal #441

santiago-su opened this issue Sep 2, 2020 · 1 comment

Comments

@santiago-su
Copy link

santiago-su commented Sep 2, 2020

Describe the bug

Currently when you use the Cookie module and try to set a cookie with days parameter it must be an Integer, not a decimal. If it is a decimal it fails silently and defaults to session length.

To Reproduce

Steps to reproduce the behavior:

  1. Require the Cookie module
  2. Call the cookie set function with some dummy data and a decimal days parameter:
    Cookie.set('test', 'test', { days: 10.5 });
  3. Check that the cookie length time defaults to session time on your browser cookie panel.

Expected behavior

Alert the user that decimals can't be used or round the number up or down instead of defaulting to session length

Additional context

Related issues:

@DiogoBatista
Copy link

@santiago-su this is the correct PR -> https://github.com/WeTransfer/frontend/pull/11168 based on the latest release at the moment

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants