Сначала вы установите куки:
var myvalue = 100, 2000, 300;
$.cookie("mycookie", myvalue);
Тогда вы получите печенье:
var getmycookie = $.cookie("mycookie");
var myvalues = getmycookie.split(",");
var firstval = myvalues[0];
var secondval = myvalues[1];
var thirdval = myvalues[2];
Не должно быть намного сложнее.
Если срок действия не указан, файл cookie удаляется в конце сеанса, т.е. при закрытии браузера.
РЕДАКТИРОВАТЬ: Вы также можете указать путь:
$.cookie("mycookie", myvalue, {
expires : 10, //expires in 10 days
path : '/products', //The value of the path attribute of the cookie
//(default: path of page that created the cookie).
domain : 'http://localhost:8080', //The value of the domain attribute of the cookie
//(default: domain of page that created the cookie).
secure : true //If set to true the secure attribute of the cookie
//will be set and the cookie transmission will
//require a secure protocol (defaults to false).
});
Я думаю, что-то вроде этого сделает:
var myvalue = 100, 2000, 300;
$.cookie("mycookie", myvalue, {path : '/audi/products'});
О, и сеанс заканчивается, когда браузер закрывается, а не когда страница выгружается, поэтому сессионный cookie подойдет.