-
I've made a "flash message" using the alert component that I want to show exactly once when someone successfully updates a resource. So for example if I set a cookie like this: update users set
name = :name,
email = :email
where id = :id;
select 'cookie' as component,
'admin.alert.title' as name,
'User updated' as value;
select 'redirect' as component,
'user.sql?user=' || :id as link; This cookie is correctly set. And then in the page that it redirects to, I do this: -- clear flash cookie
select 'cookie' as component, 'admin.alert.title' as name, true as remove;
--- display the value
select 'alert' as component,
sqlpage.cookie('admin.alert.title') as title,
'green' as color
where sqlpage.cookie('admin.alert.title') is not null; The alert is correctly displayed, and I can see that the HTTP headers are trying to unset the cookie in the response (expiration date is in the past): Frustratingly, Firefox and Chrome are both hanging on to the cookie and thus I'm continuing to see the alert. I don't think this is a technical problem with SQLPage because it looks like the correct HTTP header is being sent to remove the cookie, but I just can't wrap my mind around why this isn't working. In desperation I tried this, which does work.
My computer clock is correct, so I am baffled at why |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Could it be that the @lovasoa If the missing Path is the problem, then this early return could be the cause: https://github.com/lovasoa/SQLpage/blob/cef4066e872dd76b76cda3fcc43ff1088fdb5ddd/src/render.rs#L122 |
Beta Was this translation helpful? Give feedback.
-
v0.23 was released, with the fix: https://github.com/lovasoa/SQLpage/releases/tag/v0.23.0 |
Beta Was this translation helpful? Give feedback.
I made the fix myself in 6c68d1d
Thanks for reporting the issue, @E8y2FqZE !