Asp.Net Web窗体给出的iPad票错误 [英] Asp.Net Web Forms gives ticket error on iPads

查看:133
本文介绍了Asp.Net Web窗体给出的iPad票错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个安装在每个客户自己的服务器上的现有ASP.Net Web窗体应用程序。这已经使用了他们全部一段时间,从来没有真正有一个问题,我们现在有一些人通过一个iPad登录时谁得到的错误:

We have an existing ASP.Net Web Forms application that is installed on each client's own server. This has been used by them all for a while and never really had a problem, we now have some people who when logging on via an iPad get the error:

invalid value for encrypted ticket parameter

我们这里测试有iPad和我们没有得到错误,尽管让他们确保cookie被接受Safari设置,甚至要求他们试用Chrome在iPad上没有什么区别。不能够复制它使得它非常难以诊断,所以我希望有人可能已经收到了这个问题。

We have iPads here for testing and we don't get the error and despite getting them to ensure cookies are accepted in safari settings and even asking them to try Chrome on the iPad makes no difference. Not being able to replicate it makes it very difficult to diagnose so I'm hoping someone may have had this problem before.

这是使用带有自定义的MembershipProvider Forms身份验证。

It is using Forms authentication with a custom MembershipProvider.

推荐答案

您必须检查空的的HttpCookie,也为它下面给出的数值。

You have to check null for HttpCookie and also for it's value as given below .

HttpCookie authCookie = System.Web.HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName];
    if (authCookie != null)
    {
        //Extract the forms authentication cookie
        if (!string.IsNullOrEmpty(authCookie.Value))
        {
            FormsAuthenticationTicket authTicket = FormsAuthentication.Decrypt(authCookie.Value);

            string email = authTicket.UserData;

            // and now process your code as per your condition

        }
    }

这篇关于Asp.Net Web窗体给出的iPad票错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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