简体   繁体   English

更改用户后如何重定向到主页

[英]How to redirect to home page, when user is changed

I am in a problem and I hope that you guys will help me out. 我遇到了问题,希望你们能帮助我。 I have a web application, in which when I once logged in then if I open the application in a new tab in redirects me to the home page(which shows after login). 我有一个Web应用程序,登录后,如果我在新标签页中打开该应用程序,则会将我重定向到首页(登录后显示)。 but when I logout from one tab and login with a different user then my previous tab should be redirected to the home page of current user(if I perform some activity on it) 但是,当我从一个选项卡注销并以其他用户身份登录时,我的上一个选项卡应重定向到当前用户的主页(如果我对其执行一些操作)

please help me how do I achieve that..? 请帮助我如何实现这一目标..?

Thanks all 谢谢大家

you can use a small trick, place a label in your form and wrap it in timer and updatepanel now set the timer interval to 3000 and in the code behind set the user login and logout some variable and change the label text accordingly let say if 1 for loged 0 for logout so if its 1 nothing happens and if its 0 then redirect the page. 您可以使用一个小技巧,将标签放置在表单中,然后将其包装在timer和updatepanel中,现在将计时器间隔设置为3000,并在后面的代码中设置用户登录并注销一些变量,并相应地更改标签文本,假设1为已注销的0进行注销,因此如果其为1则什么也没有发生,如果其为0,则重定向页面。

hope it gives you and idea. 希望它能给您和想法。

只需使用Cookies来映射session ,似乎您在url中使用了一些ID即可将其映射到会话

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM