def __call__(self, environ, start_response): request = environ['werkzeug.request'] if request.session_store is not None: request.session_store.save_if_modified(request.session) if request.cookie_name not in request.cookies: self.set_cookie(request.cookie_name, request.session.sid) return ResponseBase.__call__(self, environ, start_response)
def __call__(self, environ, start_response): # get the request object request = environ['werkzeug.request'] if request.session_store is not None: # save the session if neccessary request.session_store.save_if_modified(request.session) # set the cookie for the browser if it is not there: if request.cookie_name not in request.cookies: self.set_cookie(request.cookie_name, request.session.sid) # go on with normal response business return ResponseBase.__call__(self, environ, start_response)