concorde.js icon indicating copy to clipboard operation
concorde.js copied to clipboard

Cookie expiry set fails when set to decimal

Open santiago-su opened this issue 4 years ago • 1 comments

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:

  • https://github.com/WeTransfer/frontend/pull/11168

santiago-su avatar Sep 02 '20 12:09 santiago-su

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

DiogoBatista avatar Sep 02 '20 15:09 DiogoBatista