Hello I currently have this code checking if a cookie exists, it works all nice and dandy until you go to a subpage, as the header part of the website is universal to all the pages.
I’m currently using this code to check the for cookie –
if(! isset( $_COOKIE['AVS'] ) )
{
header('Location: http://www.mydomain.com/splash/');
}
This is how I’m setting my cookie
<script type="text/javascript">
function createCookie() {
var name = "AVS";
var value = "AVL";
var expires = 24*60*60*1000;
document.cookie = name+"="+value+expires+"; path=/";
}
</script>
I’m also actually having problems keeping the cookie for 24 hours after the cookie is set even if the browser is closed?
I figured it out, I used PHP completely rather than any javascript and it seemed to work..here is the code I used.