سؤال

وأنا باستخدام هذا الرمز في صفحة تسجيل الدخول. هذا على ما يرام العمل.

FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(
               1, // Ticket version
               eUserName.Text,
               DateTime.Now, 
               DateTime.Now.AddMinutes(30),
               true,
               "administrator",
               FormsAuthentication.FormsCookiePath);


        string hash = FormsAuthentication.Encrypt(ticket);
        HttpCookie cookie = new HttpCookie(
           FormsAuthentication.FormsCookieName,
           hash);

        // Set the cookie's expiration time to the tickets expiration time
        if (ticket.IsPersistent) cookie.Expires = ticket.Expiration;

        // Add the cookie to the list for outgoing response
        Response.Cookies.Add(cookie);
        Response.Redirect("Default.aspx");

ولكن عندما كنت خروج باستخدام FormsAuthentication.SignOut أو آسيا والمحيط الهادئ: LoginStatus السيطرة على هذا لا خروج. هذا يبدو بتسجيل الدخول. عندما الاختبار على إنترنت إكسبلورر 8، وهذا خروج بنجاح.

ما happing على فايرفوكس؟ كيف يمكنني أن أفعل لحل هذه المشكلة؟

والشكر

وebattulga

هل كانت مفيدة؟

المحلول

والمشكلة مع فايرفوكس وFormsAuthentication هي أن فايرفوكس doens't يبدو أن حذف ملفات تعريف الارتباط المصادقة على تسجيل الخروج. 3 أشياء يمكنك أن تجرب:

1) بعد استدعاء الأسلوب تسجيل الخروج، مسح الكوكيز من هذا القبيل => Response.cookies.clear()
2) حاول الاتصال Session.abandon قبل دعوة تسجيل الخروج الخاص
3) يمكنك أيضا محاولة ما يلي: Response.Expires = 0, Response.Cache.SetNoStore(), Response.AppendHeader("Pragma", "no-cache")

والأمل تلك المساعدة!

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top