• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

cookie issue - win internet explorer

Hi, I have a script that either provides or denies entry to a user based on their answer to the question: Are you 18?

It works fine across most browsers though for some reason it crashes in Internet Explorer


age-check.php
---------------------

<?php
session_start();
$rurl = (isset($_REQUEST['rurl']))?$_REQUEST['rurl']:"/index";

// if the session exists - it is because I have answered YES - re-direct user
if(isset($_SESSION['ageok'])) header("Location:$rurl");

//If I have a cookie, initiate session and re-direct
if(isset($_COOKIE["agecookie"])){
      $_SESSION['ageok'] = TRUE;
      header("Location:$rurl");
}


// If I answer YES, create session, set cookie and re-direct
if($_REQUEST['ol'] == "yes"){
      $_SESSION['ageok'] = TRUE;
      $date=mktime(0,0,0,1,1,2025);
      setcookie("agecookie","imover18",$date,'','',0);
      header("Location:$rurl");
}

// If I answer NO, re-direct to save place
if($_REQUEST['ol'] == "no"){
      header("Location: http://www.drinkaware.co.uk");
}
      
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb" lang="en-gb">
<head>
<title>Are You 18?</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>

<body>

<h1>Are you 18?</h1>
<h2><a href="age-check.php?ol=yes&rurl=<?php echo $rurl; ?>" title="YES I AM OVER 18">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="age-check.php?ol=no&rurl=<?php echo $rurl; ?>" title="NO I AM UNDER 18">NO</a></h2>

</body>
</html>



--------------

I place this at the top of site index pages that I wish to restrict access to (entry via age check):

session_start();
$rurl = $_SERVER['REQUEST_URI'];
if(!isset($_SESSION['ageok']))
header("Location:age-check.php?rurl=".$rurl);      


For some strange reason this is provoking errors in Internet Explorer 6 and 7. The operation aborts and the page cannot be loaded.

Is there any obvious reason for this?

Another detail that may affect this: the swfobject ( http://blog.deconcept.com/swfobject/ ) is employed to insert flash into the page.
0
myrepublic
Asked:
myrepublic
1 Solution
 
SissonCommented:
Check that you have cookies enabled in your internet options settings.  reason i say this is that other browsers (such as firefox) dont use the windows/IE settings for cookie blocking.
0
 
myrepublicAuthor Commented:
Turned out to be an issue with Slimbox (Lightbox variant) as documented here: http://www.sanctifiedstudios.com/internet-explorer-cannot-open-the-internet-site-operation-aborted/
0
 
Computer101Commented:
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now