Hi there. On my website I have a simple shop where you can add items to your cart. To make things nicer, we have Javascript to handle the process to make it faster. The problem I am having is that Opera does not save the cookie that the javascript creates.
Here’s the relevant code:
function createCookie(name,value,days)
{
var expires = "";
if (days)
{
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();
}
else
expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
Full code: http://kisildalur.is/web/scripts/cart.js
You can see it live if you go to http://kisildalur.is/?p=1&id=7 click on “Kaupa” (Icelandic for Buy) on any item. You will see a nice simple animation once you do. Once an item has been added, a cookie is created but in my Opera 10.53 the cookie does not exist. Browsing any other pages will result in the cart being empty.
What am I doing wrong? :S Works for every other major browser except Opera.