def set_session_data(storage, messages):
storage.request.session[storage.session_key] = storage.serialize_messages(messages)<EOL>if hasattr(storage, '<STR_LIT>'):<EOL><INDENT>del storage._loaded_data<EOL><DEDENT>
Sets the messages into the backend request's session and remove the
backend's loaded data cache.