reload: Fix passing data to next browser session.
reload: Fix passing data to next browser session.

Apparently, Django's CSRF protection mechanism changed at some point,
and now we get a different CSRF token every time the webapp is loaded.
This, in turn, caused our reload logic to avoid losing state to be
completely ineffective, since the CSRF check in reload.initialize
always failed.

We fix this in a secure fashion by passing the reload instructions
from the browser to its reloaded self via localstorage, keyed by a
randomly generated token.  The token randomization is primarily
relevant for handling several Zulip tabs in the same browser, but also
servers to make it very difficult for an attacker to ever trigger this
code path by redirecting a browser to `/#reload` URLs.

Fixes #3411.
Fixes #3687.

jrowan/zulip,rishig/zulip,christi3k/zulip,synicalsyntax/zulip,j831/zulip,eeshangarg/zulip,shubhamdhama/zulip,synicalsyntax/zulip,j831/zulip,punchagan/zulip,rishig/zulip,jackrzhang/zulip,andersk/zulip,punchagan/zulip,andersk/zulip,shubhamdhama/zulip,timabbott/zulip,vaidap/zulip,amanharitsh123/zulip,amanharitsh123/zulip,jainayush975/zulip,eeshangarg/zulip,tommyip/zulip,andersk/zulip,kou/zulip,synicalsyntax/zulip,synicalsyntax/zulip,vabs22/zulip,jrowan/zulip,vabs22/zulip,rht/zulip,hackerkid/zulip,SmartPeople/zulip,kou/zulip,brockwhittaker/zulip,showell/zulip,eeshangarg/zulip,punchagan/zulip,amanharitsh123/zulip,jrowan/zulip,hackerkid/zulip,dhcrzf/zulip,brockwhittaker/zulip,zulip/zulip,eeshangarg/zulip,ryanbackman/zulip,jackrzhang/zulip,brainwane/zulip,j831/zulip,verma-varsha/zulip,synicalsyntax/zulip,jphilipsen05/zulip,brockwhittaker/zulip,jackrzhang/zulip,mahim97/zulip,hackerkid/zulip,zulip/zulip,ryanbackman/zulip,tommyip/zulip,brockwhittaker/zulip,christi3k/zulip,ryanbackman/zulip,kou/zulip,jackrzhang/zulip,christi3k/zulip,showell/zulip,jainayush975/zulip,SmartPeople/zulip,verma-varsha/zulip,brockwhittaker/zulip,tommyip/zulip,eeshangarg/zulip,Galexrt/zulip,showell/zulip,Galexrt/zulip,amanharitsh123/zulip,jphilipsen05/zulip,verma-varsha/zulip,rishig/zulip,rishig/zulip,dhcrzf/zulip,hackerkid/zulip,rht/zulip,timabbott/zulip,shubhamdhama/zulip,zulip/zulip,vabs22/zulip,SmartPeople/zulip,vaidap/zulip,jainayush975/zulip,kou/zulip,dhcrzf/zulip,brainwane/zulip,hackerkid/zulip,andersk/zulip,zulip/zulip,vabs22/zulip,punchagan/zulip,timabbott/zulip,jainayush975/zulip,brainwane/zulip,brockwhittaker/zulip,jphilipsen05/zulip,ryanbackman/zulip,mahim97/zulip,rishig/zulip,rishig/zulip,jainayush975/zulip,hackerkid/zulip,timabbott/zulip,jphilipsen05/zulip,mahim97/zulip,j831/zulip,andersk/zulip,rht/zulip,dhcrzf/zulip,punchagan/zulip,kou/zulip,vaidap/zulip,punchagan/zulip,rht/zulip,dhcrzf/zulip,jackrzhang/zulip,brainwane/zulip,verma-varsha/zulip,brainwane/zulip,jackrzhang/zulip,Galexrt/zulip,andersk/zulip,punchagan/zulip,tommyip/zulip,christi3k/zulip,eeshangarg/zulip,brainwane/zulip,Galexrt/zulip,jrowan/zulip,mahim97/zulip,shubhamdhama/zulip,eeshangarg/zulip,vabs22/zulip,showell/zulip,tommyip/zulip,verma-varsha/zulip,showell/zulip,jphilipsen05/zulip,zulip/zulip,rht/zulip,brainwane/zulip,andersk/zulip,vabs22/zulip,mahim97/zulip,christi3k/zulip,amanharitsh123/zulip,dhcrzf/zulip,hackerkid/zulip,showell/zulip,Galexrt/zulip,j831/zulip,mahim97/zulip,Galexrt/zulip,vaidap/zulip,synicalsyntax/zulip,rht/zulip,zulip/zulip,showell/zulip,timabbott/zulip,shubhamdhama/zulip,christi3k/zulip,ryanbackman/zulip,SmartPeople/zulip,jackrzhang/zulip,kou/zulip,jainayush975/zulip,Galexrt/zulip,jrowan/zulip,rishig/zulip,zulip/zulip,SmartPeople/zulip,timabbott/zulip,verma-varsha/zulip,kou/zulip,ryanbackman/zulip,dhcrzf/zulip,jphilipsen05/zulip,SmartPeople/zulip,jrowan/zulip,tommyip/zulip,amanharitsh123/zulip,vaidap/zulip,synicalsyntax/zulip,rht/zulip,vaidap/zulip,tommyip/zulip,j831/zulip,shubhamdhama/zulip,timabbott/zulip,shubhamdhama/zulip