rework flash messages to be done via a cookie

(eventually this will be a lot more convenient in terms of caching)