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 8450993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:07:09+00:00 2026-06-10T11:07:09+00:00

So based on information here Safari 3rd party cookie iframe trick no longer working?

  • 0

So based on information here Safari 3rd party cookie iframe trick no longer working? and here Missing cookies on iframe in safari 5.1.5 it’s clear that old tricks wont work:

from django.http import HttpResponse
from django.conf import settings


SESSION_COOKIE_NAME = getattr(settings, 'SESSION_COOKIE_NAME')

class SafariIFrameFixMiddleware(object):
    """
    Middleware fixes sessions with Safari browser in iframes

    Safari default security policy restricts
    cookie setting in first request in iframe

    Solution is to create hidden form to preserve GET variables
    and REPOST it to current URL
    """
    def process_request(self, request):
        if request.META['HTTP_USER_AGENT'].find('Safari') != -1 \
                and request.META['HTTP_USER_AGENT'].find('Chrome') == -1 \
                and SESSION_COOKIE_NAME not in request.COOKIES \
                and 'cookie_fix' not in request.GET:
            html = """<html><body><form name='cookie_fix' method='GET' action='.'>"""
            for item in request.GET:
                html += "<input type='hidden' value='%s' name='%s' />" % (request.GET[item], item)
            html += "<input type='hidden' name='cookie_fix' value='1' />"
            html += "</form>"
            html += '''<script type="text/javascript">document.cookie_fix.submit()</script></html>'''
            return HttpResponse(html)
        else:
            return

So I’m seeking new way to solve it.

It seems that it requires open up window (with user permission/click or it will be blocked by safari) and start session there.

Problem is that the very same popup page will ran true all of the middlewares thus it not may be always viable inside project (want as little intrusive fix as possible).

Also django session starting is inside middleware as well, I haven’t found any clean way of starting one manually. Any suggestions?

  • 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-06-10T11:07:10+00:00Added an answer on June 10, 2026 at 11:07 am

    I’ve created working version of fix and uploaded to pypi here: http://pypi.python.org/pypi/django-iframetoolbox

    Note: It might not be stable until 0.2 version

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

Sidebar

Related Questions

I'm working on a C# XNA project that requires me to display information based
The Goal: To retrieve information from a 3rd party database based off of a
I'm asked to get the information based on a specific ID( here 406f-871b-a3ee71f7038) ,
I have a Windows.Forms based .NET desktop application that stores privileged information in a
I am making a QT application that updates the window based on the information
I have written a 2D Perlin noise implementation based on information from here ,
In views.py: get_dict = Site.objects.getDictionary(request.COOKIES['siteid']) {gets a dictionary with site information based on id
I am trying to route a message based on information in a XML snippet
My script puts together a set of htaccess rules based on information passed into
I'm trying to modify the decimal-format of a stylesheet based on certain information of

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.