• Resolved zachop

    (@zachop)


    Hi there!

    This isn’t actually a bug, but a heads-up. In the popup’s cookie settings, the Cookie Time field’s description states that the user is expected to enter a “plain english time”.

    This is a bit ambiguous and might cause issues, since numbers written as text (e.g. “one month”, “two days”) are not correctly parsed by the plugin’s strtotime functionality, which in turn leads to the cookie not being set.

    I suppose that the “plain english” guideline could lead to even more unexpected user input, such as “in a month”.

    I would suggest a more detailed description for that field, or maybe even some examples of the expected input (e.g. “1 month”, “15 days”).

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Daniel Iser

    (@danieliser)

    @zachop – Funny enough what your asking for is already there, but since we pass in a default value for the cookie time, you don’t see it. The placeholder on the cookie time field reads “364 days 23 hours 59 minutes 59 seconds”. Also of note our strtotime function is not the PHP version, but rather the JS version which was created to imitate what PHP does. That said you are correct in that it doesn’t support “one week” vs “1 week”. You can read more at https://phpjs.org/functions/strtotime/.

    Hope that helps, and I will look at moving that from placeholder text to the field description.

    Thread Starter zachop

    (@zachop)

    @danieliser you’re right. I got involved with troubleshooting that setting after an unsupported value had already been stored, so I didn’t get a chance to read the placeholder.

    Thanks for your time!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Cookie settings – valid input for cookie time’ is closed to new replies.