user1070036 user1070036 - 10 months ago 124
Python Question

Python flask flash message exception remains after restarting

I'm making a small flask app where I had something like this:

def logout():
session.pop('logged_in', None)
return redirect('/index')

Needless to say when I ran the application and I navigated to '/bye' it gave me a UnicodeDecodeError. Well, now it gives me the same unicodedecodeerror on every page that extends the base template (which renders the messages) even after restarting the application. and always with the same dump() despite removing that flash in the source code. All I can think of is what the crap? Help please.

Well I had to restart my computer to clear the stupid session cache or something.


I think that flash() actually creates a session called session['_flashes']. See this code here. So you will probably have to either:

clear/delete the cookie 


session.pop('_flashes', None)