如何使用url防止外部登录? [英] How to prevent external login using url?

查看:76
本文介绍了如何使用url防止外部登录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中我们有登录系统。在我的应用程序注销后我在地址栏输入url ...如何避免使用URL登录?

in my app we have login system.after logout in my app i enter url in address bar... how to avoid login using url?

推荐答案

On你的登录页面放了这个..Madhuuuuuuuuuuuu



On your Loginpage put this..Madhuuuuuuuuuuuuu

protected void Page_Load(object sender, EventArgs e)
   {
       if (!IsPostBack)
       {
           Response.Cache.SetCacheability(HttpCacheability.NoCache);
           Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1));
           Response.Cache.SetNoStore();
           Response.Buffer = true;
           Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d);
           Response.Expires = -1500;
           Response.CacheControl = "";
           if (Session["username"] == null)
           {
               Response.Redirect("../Login.aspx");
           }
       }


这篇关于如何使用url防止外部登录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆