#NEWLINE# def add_logout_reason( request , response , reason ) : #NEWLINE# #INDENT# lang = translation . get_language_from_request ( request ) #NEWLINE# with translation . override ( lang ) : #NEWLINE# #INDENT# reason = unicode ( reason ) . encode ( 'utf-8' ) #NEWLINE# response . set_cookie ( 'logout_reason' , reason , max_age = 10 )