You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Dream.flash_messages middleware currently always sets a dream.flash cookie — it's just empty if there are no flash messages. The same empty, unconditional dream.flash cookie is also used to effectively "delete" flash messages after they have been "received" by the next request, by overwriting them with the same empty message list.
This can be observed by running the w-flash example and looking in the network tab, where a dream.flash cookie will appear on the very first request — even though there are no flash messages set yet.
What should happen instead is:
If there were no flash messages, and none are added during a particular request, no cookie should be set.
If there were flash messages, and none are added during a request, the cookie should be deleted by setting ~expires:0. on the returned cookie.
The
Dream.flash_messages
middleware currently always sets adream.flash
cookie — it's just empty if there are no flash messages. The same empty, unconditionaldream.flash
cookie is also used to effectively "delete" flash messages after they have been "received" by the next request, by overwriting them with the same empty message list.This can be observed by running the
w-flash
example and looking in the network tab, where adream.flash
cookie will appear on the very first request — even though there are no flash messages set yet.What should happen instead is:
~expires:0.
on the returned cookie.The "lightly offending" code is here:
dream/src/middleware/flash.ml
Lines 24 to 33 in 5f6b7f5
The text was updated successfully, but these errors were encountered: