Safari and opera embedded iframe page cookie reading Solution

Source: Internet
Author: User

The reason is that the third-party cookie security authentication is strict in these browsers. You must confirm that the user takes the initiative to access the Third-Party website to read the cookie, therefore, you need to click a boot page to access our components.
1. The homepage determines whether these browsers are used. If so, the page is guided. The reflag determines whether the page has been visited. If the page has been guided, the page will not be guided.
Copy codeThe Code is as follows:
Function safarireload ()
{
Var rehref = window. location. href;
If (jQuery. browser. safari & <%= reflag % >== '0 ')
{
Window. location. href = '/safarireload. aspx? Rehref = '+ rehref;
}
If (jQuery. browser. opera & <% = reflag %> = '0 ')
{
Window. location. href = '/safarireload. aspx? Rehref = '+ rehref;
}
}

Background code
Copy codeThe Code is as follows:
Public string reflag = "3 ";
If (Request. QueryString ["reflag"]! = Null & Request. QueryString ["reflag"]. ToString ()! = "")
{
Reflag = Request. QueryString ["reflag"]. ToString (). Trim ();
}
Else
{
Reflag = "0 ";
}

2. The Boot page rehref is the page to be returned
<Asp: Button ID = "Button1" CssClass = "rb1-12" runat = "server" Text = "your apple browser or opera, please click to enter the movie ticket ordering component! "OnClick =" button#click "/>
Background code
Copy codeThe Code is as follows:
Protected void button#click (object sender, EventArgs e)
{
If (Request. QueryString ["rehref"]! = Null & Request. QueryString ["rehref"]. ToString ()! = "")
{
Kaixindo. syslog (Request. QueryString ["rehref"]. ToString ());
Response. Redirect (Request. QueryString ["rehref"]. ToString () + "& reflag = 1 ");
}
}

On the boot page, use js to retrieve the url parameter rehref, which provides better page performance. But first.

Correct the code redundancy or efficiency. I hope to help some people.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.