0

Example code:

RequestHandlerA(tornado.web.RequestHandler):
    def get/post(self):
       ...
       redirect('/index?username=user0&password=user0')
       ...

RequestHandlerB(tornado.web.RequestHandler):
    def get/post(self):
       ...
       render('index.html')
       ...

RequestHandlerA redirects to RequestHandlerB which then renders the index.html.

At this point, the browser's URL looks like this :

/index?username=user0&password=user0

I'd like to remove the username and password arguments from the URL. How can I do that?

The "redirect" is necessary. So, what can I do in RequestHandlerB for this question?

foree
  • 33
  • 5
  • Why not make a redirect like `redirect('/index')`? Also, it is a bad practice to log a user in using a GET request, because this way the password is the part of the URL and it will be saved in the browser history. – xyres Sep 27 '17 at 18:50
  • **`redirect('/index')`** will not contain the usename and password , how can i send these informations to RequestHandlerB? – foree Sep 28 '17 at 01:49
  • Oh, I can set the cookies. – foree Sep 28 '17 at 03:28

0 Answers0