Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5943149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:21:13+00:00 2026-05-22T16:21:13+00:00

I asked this question a while back and found that IE blocks cross-domain cookies

  • 0

I asked this question a while back and found that IE blocks cross-domain cookies in an iframe unless you set a p3p policy. So far, the p3p fix has worked beautifully in ie. However, now we are getting the same error in safari.

I found an article with a different p3p policy for safari. I added this code to set up the p3p policy, but I am still getting a request verification token error.

public static void SetP3PCompactPolicy()
{
    HttpContext current = HttpContext.Current;

    if (current.Request.UserAgent.ToLower().IndexOf("safari") >= 0)
        HttpContext.Current.Response.AddHeader("p3p", "CP=\"IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA\"");
    else
        HttpContext.Current.Response.AddHeader("p3p", "CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"");
}

I’m not sure what any of that means, but it isn’t working for Safari (5).

Also, when I get a server error, all information is sent to me in a report, including all the http headers. The p3p header never comes through in these errors. I’m not sure if that is by design or if it is an indicator of the issue going on.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T16:21:14+00:00Added an answer on May 22, 2026 at 4:21 pm

    The issue is that Safari does not allow a cookie to be set in an iframe unless the user interacts with that iframe. For some, that means clicking a link. I found a better solution which is to do a redirect.

    First, I put this form on my page. Actually, I put it in the masterpage that is used by every view served in the iframe.

    <% if(SecurityHelper.BrowserIsSafari) { %>
        <% using (Html.BeginForm("SafariRedirect", "Framed", FormMethod.Post, new { id="safari-fix-form" })) { %>
           <%: Html.Hidden("safariRedirectUrl")%>
        <% } %>
    <% } %>
    

    Because I only want this to work when the user is using safari, I created this property in a static helper class to check the useragent

    public static bool BrowserIsSafari
    {
        get { return HttpContext.Current.Request.UserAgent.ToLower().IndexOf("safari") >= 0; }
    }
    

    Then, in my controller, I have the following action

    [HttpPost]
    public ActionResult SafariRedirect(string safariRedirectUrl)
    {
        Response.Cookies.Add(new HttpCookie("safari_cookie_fix", "cookie ok"));
    
        return Redirect(safariRedirectUrl);
    }
    

    In my masterpage, in the header, I have my script declared within the same if statement that determines if the form is rendered. In my script file, I have this jquery

    $(function () {
    
        if ($.browser.safari == true && document.cookie.indexOf("safari_cookie_fix") == -1) {
            var url = location.href;
    
            $('#safariRedirectUrl').val(url);
            $('#safari-fix-form').submit();
        }
    
    });
    

    The first time the iframe loads a page, if it is safari and the cookie isn’t set, the form is posted, the cookie set, and the user is redirected back to the same url.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I asked this question a while back but now I'm looking to implement an
This is related to this question I asked a while back. The end game
I asked this question a while back and even though I put up several
This is continuation to the question I already asked a while back. I've been
This question is related to this question I asked a little while back. The
I previously asked a similar question on this topic a while back and got
I asked this question a while ago and got an answer that I thought
So basically I asked this question while back: The query contains references to items
Similar to what I asked in this question a while back about getting the
This question was asked quite some time ago, and while it covers possible solutions

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.