Re: [squid-users] Splash page doesn't work on every web browser

From: Andrew Beverley <andy_at_andybev.com>
Date: Sat, 10 Aug 2013 12:24:29 +0100

On Thu, 2013-08-08 at 22:53 -0300, Roberto Carna wrote:
> In some cases depending on the Windows platform and web browser type
> and version (Firefox, IE, etc.), the splash page works OK but in other
> cases doesn't at al.
>
> Is there any way to implement an univeralñ splash page that work for
> all Windows + web browser scenarios ???

I had a similar problem, which I think was being caused by other
software on the computer triggering the splash page (antivirus, updates
etc).

I found the most reliable way was to force the user to "accept" the
splash page before it was removed.

It was a while ago when I did this, but I've just looked back through my
code and in summary:

- I configured Squid as per [1] to show the splash page for a fixed
timeout using an external session helper. Ignore the comments about
recent patches - they are now in the stable Squid release.

- The splash page was created in PHP page with a button that when
"accepted" wrote to the external session helper's database

- Once the session's helper database had recorded the client's details
then it allowed the user access

<?php
$session_helper = 'sudo -u proxy /usr/lib/squid3/ext_session_acl -a -T 10800 -b /var/lib/squid/session';

if (isset($_GET['takemetothepage'])) {
  $handle = popen($session_helper, 'w');
  fwrite($handle, "10 " . $_SERVER['REMOTE_ADDR'] . " LOGIN\n");
  pclose($handle);
  header("Location: http://www.google.co.uk");
  exit;
}

// Your splash HTML here
?>
Click <a href="
<?php echo $_SERVER['PHP_SELF'] . "?takemetothepage"; ?>
">here</a> to continue.

[1] http://www.andybev.com/index.php/Setting_up_a_captive_portal_from_scratch_using_Debian#Configure_Squid
Received on Sat Aug 10 2013 - 11:24:46 MDT

This archive was generated by hypermail 2.2.0 : Sat Aug 10 2013 - 12:00:08 MDT