luci-base: improve login/logout handling
luci-base: improve login/logout handling

Redirect to the canonical url after login and redirect to an url without
security token if the session expired. Also make sure that the login page
is served with status code 403, not 200 to give ajax calls a chance to
detect expired sessions.

Signed-off-by: Jo-Philipp Wich <a9275913d515487ffaed469337a530ed202da558@openwrt.org>

db260179/openwrt-bpi-r1-luci,marcel-sch/luci,nmav/luci,Sakura-Winkey/LuCI,RuiChen1113/luci,Hostle/luci,Hostle/luci,cshore/luci,lbthomsen/openwrt-luci,jorgifumi/luci,aa65535/luci,LuttyYang/luci,bright-things/ionic-luci,Hostle/openwrt-luci-multi-user,schidler/ionic-luci,teslamint/luci,oneru/luci,RuiChen1113/luci,Wedmer/luci,cshore/luci,florian-shellfire/luci,bittorf/luci,tcatm/luci,zhaoxx063/luci,deepak78/new-luci,mumuqz/luci,forward619/luci,obsy/luci,cshore-firmware/openwrt-luci,maxrio/luci981213,aa65535/luci,openwrt/luci,joaofvieira/luci,taiha/luci,remakeelectric/luci,openwrt/luci,kuoruan/lede-luci,kuoruan/lede-luci,nwf/openwrt-luci,david-xiao/luci,Wedmer/luci,kuoruan/luci,joaofvieira/luci,db260179/openwrt-bpi-r1-luci,fkooman/luci,daofeng2015/luci,david-xiao/luci,rogerpueyo/luci,dwmw2/luci,LuttyYang/luci,sujeet14108/luci,lbthomsen/openwrt-luci,MinFu/luci,dwmw2/luci,ff94315/luci-1,chris5560/openwrt-luci,wongsyrone/luci-1,NeoRaider/luci,thess/OpenWrt-luci,urueedi/luci,kuoruan/lede-luci,LazyZhu/openwrt-luci-trunk-mod,RedSnake64/openwrt-luci-packages,oneru/luci,taiha/luci,Hostle/luci,lcf258/openwrtcn,maxrio/luci981213,LuttyYang/luci,jchuang1977/luci-1,cshore/luci,bright-things/ionic-luci,Noltari/luci,Hostle/openwrt-luci-multi-user,ReclaimYourPrivacy/cloak-luci,openwrt/luci,RedSnake64/openwrt-luci-packages,oneru/luci,rogerpueyo/luci,ReclaimYourPrivacy/cloak-luci,Wedmer/luci,mumuqz/luci,schidler/ionic-luci,taiha/luci,tcatm/luci,fkooman/luci,daofeng2015/luci,mumuqz/luci,mumuqz/luci,Sakura-Winkey/LuCI,wongsyrone/luci-1,joaofvieira/luci,hnyman/luci,florian-shellfire/luci,lbthomsen/openwrt-luci,schidler/ionic-luci,bittorf/luci,bright-things/ionic-luci,Noltari/luci,mumuqz/luci,981213/luci-1,cshore-firmware/openwrt-luci,wongsyrone/luci-1,remakeelectric/luci,Hostle/luci,tobiaswaldvogel/luci,dwmw2/luci,openwrt-es/openwrt-luci,LuttyYang/luci,rogerpueyo/luci,obsy/luci,nmav/luci,tcatm/luci,cshore/luci,urueedi/luci,RedSnake64/openwrt-luci-packages,rogerpueyo/luci,ollie27/openwrt_luci,dwmw2/luci,daofeng2015/luci,david-xiao/luci,deepak78/new-luci,shangjiyu/luci-with-extra,tobiaswaldvogel/luci,marcel-sch/luci,kuoruan/luci,jorgifumi/luci,981213/luci-1,florian-shellfire/luci,zhaoxx063/luci,obsy/luci,chris5560/openwrt-luci,RuiChen1113/luci,tobiaswaldvogel/luci,david-xiao/luci,slayerrensky/luci,marcel-sch/luci,teslamint/luci,ollie27/openwrt_luci,oyido/luci,kuoruan/luci,bright-things/ionic-luci,Noltari/luci,urueedi/luci,remakeelectric/luci,nmav/luci,florian-shellfire/luci,tcatm/luci,LazyZhu/openwrt-luci-trunk-mod,chris5560/openwrt-luci,slayerrensky/luci,lcf258/openwrtcn,shangjiyu/luci-with-extra,LuttyYang/luci,lcf258/openwrtcn,LazyZhu/openwrt-luci-trunk-mod,ff94315/luci-1,LazyZhu/openwrt-luci-trunk-mod,Noltari/luci,maxrio/luci981213,urueedi/luci,NeoRaider/luci,florian-shellfire/luci,MinFu/luci,openwrt-es/openwrt-luci,lcf258/openwrtcn,maxrio/luci981213,jchuang1977/luci-1,mumuqz/luci,jlopenwrtluci/luci,tobiaswaldvogel/luci,jchuang1977/luci-1,Noltari/luci,Wedmer/luci,male-puppies/luci,NeoRaider/luci,shangjiyu/luci-with-extra,david-xiao/luci,MinFu/luci,joaofvieira/luci,nmav/luci,male-puppies/luci,NeoRaider/luci,oyido/luci,cappiewu/luci,Hostle/openwrt-luci-multi-user,shangjiyu/luci-with-extra,db260179/openwrt-bpi-r1-luci,tcatm/luci,kuoruan/luci,bright-things/ionic-luci,RedSnake64/openwrt-luci-packages,fkooman/luci,jchuang1977/luci-1,Hostle/luci,ollie27/openwrt_luci,deepak78/new-luci,wongsyrone/luci-1,kuoruan/lede-luci,sujeet14108/luci,lcf258/openwrtcn,taiha/luci,lbthomsen/openwrt-luci,cappiewu/luci,kuoruan/luci,teslamint/luci,jlopenwrtluci/luci,RuiChen1113/luci,Wedmer/luci,male-puppies/luci,dwmw2/luci,oyido/luci,cshore-firmware/openwrt-luci,slayerrensky/luci,cshore/luci,zhaoxx063/luci,ff94315/luci-1,male-puppies/luci,remakeelectric/luci,jorgifumi/luci,thesabbir/luci,lbthomsen/openwrt-luci,tobiaswaldvogel/luci,obsy/luci,zhaoxx063/luci,LazyZhu/openwrt-luci-trunk-mod,thesabbir/luci,nwf/openwrt-luci,deepak78/new-luci,kuoruan/lede-luci,thess/OpenWrt-luci,daofeng2015/luci,cappiewu/luci,deepak78/new-luci,dwmw2/luci,fkooman/luci,openwrt-es/openwrt-luci,deepak78/new-luci,thesabbir/luci,urueedi/luci,jchuang1977/luci-1,artynet/luci,NeoRaider/luci,ReclaimYourPrivacy/cloak-luci,aa65535/luci,Hostle/luci,slayerrensky/luci,bittorf/luci,zhaoxx063/luci,remakeelectric/luci,Hostle/luci,MinFu/luci,db260179/openwrt-bpi-r1-luci,lbthomsen/openwrt-luci,jchuang1977/luci-1,slayerrensky/luci,Hostle/openwrt-luci-multi-user,schidler/ionic-luci,oneru/luci,jlopenwrtluci/luci,ReclaimYourPrivacy/cloak-luci,ReclaimYourPrivacy/cloak-luci,mumuqz/luci,hnyman/luci,NeoRaider/luci,obsy/luci,db260179/openwrt-bpi-r1-luci,openwrt/luci,RedSnake64/openwrt-luci-packages,LuttyYang/luci,RuiChen1113/luci,aa65535/luci,jchuang1977/luci-1,sujeet14108/luci,thesabbir/luci,Sakura-Winkey/LuCI,ollie27/openwrt_luci,Hostle/openwrt-luci-multi-user,fkooman/luci,bittorf/luci,cshore-firmware/openwrt-luci,nmav/luci,fkooman/luci,deepak78/new-luci,ff94315/luci-1,zhaoxx063/luci,rogerpueyo/luci,daofeng2015/luci,fkooman/luci,jlopenwrtluci/luci,chris5560/openwrt-luci,lcf258/openwrtcn,teslamint/luci,Hostle/openwrt-luci-multi-user,chris5560/openwrt-luci,jorgifumi/luci,remakeelectric/luci,jorgifumi/luci,LazyZhu/openwrt-luci-trunk-mod,ollie27/openwrt_luci,kuoruan/lede-luci,schidler/ionic-luci,LuttyYang/luci,Hostle/openwrt-luci-multi-user,openwrt-es/openwrt-luci,teslamint/luci,urueedi/luci,openwrt/luci,hnyman/luci,forward619/luci,LazyZhu/openwrt-luci-trunk-mod,thess/OpenWrt-luci,obsy/luci,jlopenwrtluci/luci,maxrio/luci981213,florian-shellfire/luci,joaofvieira/luci,cappiewu/luci,Wedmer/luci,aa65535/luci,Sakura-Winkey/LuCI,NeoRaider/luci,oyido/luci,LazyZhu/openwrt-luci-trunk-mod,daofeng2015/luci,urueedi/luci,RedSnake64/openwrt-luci-packages,shangjiyu/luci-with-extra,lbthomsen/openwrt-luci,marcel-sch/luci,Noltari/luci,ollie27/openwrt_luci,sujeet14108/luci,lcf258/openwrtcn,obsy/luci,bright-things/ionic-luci,oyido/luci,lcf258/openwrtcn,thess/OpenWrt-luci,artynet/luci,openwrt-es/openwrt-luci,florian-shellfire/luci,rogerpueyo/luci,zhaoxx063/luci,nmav/luci,bittorf/luci,artynet/luci,nwf/openwrt-luci,thess/OpenWrt-luci,thess/OpenWrt-luci,Wedmer/luci,sujeet14108/luci,tobiaswaldvogel/luci,jorgifumi/luci,oyido/luci,mumuqz/luci,nwf/openwrt-luci,ff94315/luci-1,artynet/luci,shangjiyu/luci-with-extra,nwf/openwrt-luci,hnyman/luci,kuoruan/lede-luci,Hostle/luci,oneru/luci,david-xiao/luci,kuoruan/luci,forward619/luci,tcatm/luci,db260179/openwrt-bpi-r1-luci,male-puppies/luci,openwrt-es/openwrt-luci,LuttyYang/luci,marcel-sch/luci,schidler/ionic-luci,florian-shellfire/luci,shangjiyu/luci-with-extra,hnyman/luci,jlopenwrtluci/luci,Sakura-Winkey/LuCI,MinFu/luci,Sakura-Winkey/LuCI,oyido/luci,chris5560/openwrt-luci,MinFu/luci,joaofvieira/luci,joaofvieira/luci,forward619/luci,jchuang1977/luci-1,deepak78/new-luci,slayerrensky/luci,artynet/luci,dwmw2/luci,ff94315/luci-1,teslamint/luci,Sakura-Winkey/LuCI,lbthomsen/openwrt-luci,db260179/openwrt-bpi-r1-luci,ff94315/luci-1,bright-things/ionic-luci,ollie27/openwrt_luci,Wedmer/luci,nwf/openwrt-luci,cshore-firmware/openwrt-luci,remakeelectric/luci,kuoruan/luci,cappiewu/luci,cappiewu/luci,cshore-firmware/openwrt-luci,openwrt-es/openwrt-luci,nmav/luci,MinFu/luci,david-xiao/luci,artynet/luci,981213/luci-1,cshore-firmware/openwrt-luci,Noltari/luci,RuiChen1113/luci,ollie27/openwrt_luci,wongsyrone/luci-1,RedSnake64/openwrt-luci-packages,openwrt/luci,rogerpueyo/luci,forward619/luci,981213/luci-1,ReclaimYourPrivacy/cloak-luci,taiha/luci,teslamint/luci,cshore/luci,sujeet14108/luci,cappiewu/luci,chris5560/openwrt-luci,chris5560/openwrt-luci,ReclaimYourPrivacy/cloak-luci,hnyman/luci,david-xiao/luci,rogerpueyo/luci,tobiaswaldvogel/luci,marcel-sch/luci,forward619/luci,bittorf/luci,nwf/openwrt-luci,dwmw2/luci,nmav/luci,maxrio/luci981213,marcel-sch/luci,wongsyrone/luci-1,NeoRaider/luci,bittorf/luci,nmav/luci,artynet/luci,tcatm/luci,thesabbir/luci,wongsyrone/luci-1,daofeng2015/luci,schidler/ionic-luci,oyido/luci,male-puppies/luci,lcf258/openwrtcn,thesabbir/luci,RuiChen1113/luci,lcf258/openwrtcn,zhaoxx063/luci,Hostle/openwrt-luci-multi-user,kuoruan/luci,aa65535/luci,slayerrensky/luci,cshore/luci,bittorf/luci,joaofvieira/luci,forward619/luci,marcel-sch/luci,oneru/luci,obsy/luci,jlopenwrtluci/luci,male-puppies/luci,teslamint/luci,thesabbir/luci,db260179/openwrt-bpi-r1-luci,aa65535/luci,wongsyrone/luci-1,artynet/luci,slayerrensky/luci,oneru/luci,981213/luci-1,taiha/luci,oneru/luci,tobiaswaldvogel/luci,jorgifumi/luci,hnyman/luci,openwrt-es/openwrt-luci,remakeelectric/luci,daofeng2015/luci,Noltari/luci,taiha/luci,981213/luci-1,aa65535/luci,cappiewu/luci,RuiChen1113/luci,981213/luci-1,maxrio/luci981213,thess/OpenWrt-luci,jlopenwrtluci/luci,sujeet14108/luci,maxrio/luci981213,thesabbir/luci,artynet/luci,cshore/luci,Sakura-Winkey/LuCI,bright-things/ionic-luci,shangjiyu/luci-with-extra,taiha/luci,thess/OpenWrt-luci,schidler/ionic-luci,ff94315/luci-1,MinFu/luci,Noltari/luci,cshore-firmware/openwrt-luci,fkooman/luci,sujeet14108/luci,openwrt/luci,tcatm/luci,male-puppies/luci,jorgifumi/luci,ReclaimYourPrivacy/cloak-luci,forward619/luci,nwf/openwrt-luci,openwrt/luci,hnyman/luci,kuoruan/lede-luci,urueedi/luci