Update index.php

Adding (at the end) another else case, using $_COOKIE['cookie_portal'] and a new function,already_connected($_COOKIE['cookie_portal']) (defined in /etc/inc/captiveportal.inc)

Added some Java code to destroy the cookie on logout