Show only once cookie expiration date

Created on 16 May 2023, over 1 year ago
Updated 18 November 2024, about 1 month ago

Problem/Motivation

The show only once option adds a hide cookie with a hardcoded "365 * 20" expiration date. This makes it impossible to have a "Show only once" for session or other small timeframes.
Would it make sense for it to respect the Default Cookie Expiration date set on the module settings? Alternatively it could also have its own expiration date but this would probably be over-complicating a simple feature.

Any ideas on this?

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

5.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @luiscarvalho
  • First commit to issue fork.
  • Hello,

    I created a merge request to be able to use a session cookie instead of the 365*20 expiration date cookie.
    It adds a new checkbox in the extra section.

    Regards,
    Vanessa

  • 🇧🇷Brazil renatog Campinas

    Amazing! Let’s test it

    Thank you so much Vanessa! Really appreciates your contribution

  • 🇧🇷Brazil renatog Campinas

    Verified that on MR we updated an existing hook_update, right?!

    On this case we need to create a new exclusive hook update, because we can have websites running in production that already executed all pending hook updates, and this hook won’t be executed again

    So, if possible, I’d suggest creating a new hook updated specifically for this

  • Hello Renatog,

    I didn't increment the hook_update because i don't have any table called "modal" created and got an error when i tried to use an exclusive hook_update. So I'm not sure about this part.
    I had modal_page already installed from before on my environment and without running the updb, the new field was displayed and saved.

    This table was used in previous versions of the module?

  • 🇧🇷Brazil renatog Campinas

    I didn't increment the hook_update because i don't have any table called "modal"

    But the idea of this hook_update is set the default of this new field for all existent modals, you know?

    • So let's imagine that one website has 10 modals
    • This field don't exists yet
    • After this update, the field will be there
    • But should have a "default value" right?
    • For example, false, or 0
    • So, Maybe we need to create a hook update that:
    • A) Will load all Modals
    • B) Will set the default value for this new field (false or 0, etc)
    • C) Save
Production build 0.71.5 2024