I’m asking this in advance before I attempt this tomorrow
Has anyone implemented “flash messages” (a.k.a. notifications) though cookies?
Like, imagine a user registration form: after you click “Register” and it’s a success, you set a message in a cookie and redirect to the index page. In the index page, there’s a conditional region that shows the message in the cookie ("Account registered, you can now login ") if present.
Has anyone done this? I never dabbled with cookies before, if someone has pointers I appreciate them
P.S: This last sentence was confusing to write in proper English. If the grammar is incorrect, please do tell me!
But this sets an object instead of an array containing that object, so it doesn’t work - I want the ability to push multiple messages into it. How can I do so? I tried using the Array component but it only seems to accept strings and not objects, at least looking at the UI
On the main layout I put a server connect call to the one shown in the screenshot above
And then I put a div with a repeat to show the messages from this server connect call data, coupled with a dmx-show attribute to only show this div if there are messages to be shown.
Once a message is shown it’s erased from the session (as screenshot above), so it’s not shown again on subsequent page loads