I have a cookie that is on every page of my site. It works fine when the address is like this. http://mydomain.com/index.html or whatever.
but when I have a page that is in a folder like this http://mydomain.com/folder/page.html
instead of using the cookie that I have set for all the other pages it creates a new cookie just for that folder. Is there any way to keep the same cookie for all folders? Or I'm I just doing something terrible wrong?
Thanks
my code -- I have this in a external js. file
$(document).ready(function(){
var cookie = $.cookie('cookiename');
if (cookie) {
}
else {
$.cookie('cookiename', 'cookievalue');
}
});
$(document).ready(function() {
$('.watevevever').click(function() {
var va = $('#watev').css('display');
if (va == 'none'){
$('#watev').fadeIn("slow");
$.cookie('cookiename', 'cookievalue');
}
else {
$('#watev').fadeOut("slow");
$.cookie('cookiename', 'cookievalue');
}
});
var va = $.cookie('cookiename');
if (va == 'cookievalue') {
$('#watev').css("display","none");
};
});