Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function cookieFix(){
- $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
- //Set up P3P policy to allow cookies in iframe with IE
- if(strpos($user_agent, 'MSIE')){
- header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');
- }
- //Workaround for Safari - post a form with Javascript to create session cookie
- if(empty($_COOKIE[session_name()]) && strpos($user_agent,'Safari') && isset($_GET['dr_auth_code']) && !isset($_GET['dr_cookie_fix'])){
- ?>
- <html><head><title>Iframe Cookie fix</title></head>
- <body>
- <form name="cookieFix" method="get" action="">
- <?php foreach($_GET as $key=>$val){
- echo '<input type="hidden" name="'.htmlspecialchars($key).'" value="'.htmlspecialchars($val).'" />';
- } ?>
- <input type="hidden" name="dr_cookie_fix" value="1" />
- <noscript><input type="submit" value="Continue" /></noscript>
- </form>
- <script type="text/javascript">document.cookieFix.submit();</script>
- </body></html>
- <?php
- exit;
- }
- }
Add Comment
Please, Sign In to add comment