concorde.js
concorde.js copied to clipboard
Cookie expiry set fails when set to decimal
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:
- Require the Cookie module
- Call the cookie
set
function with some dummy data and a decimal days parameter:Cookie.set('test', 'test', { days: 10.5 });
- 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 this is the correct PR -> https://github.com/WeTransfer/frontend/pull/11168 based on the latest release at the moment