add more rows to jquery cookies or appending to query cookie
I am using following code to check cookie availability and create a new cookie. If cookie exists then I need to one more row to the existing cookie.
function addUsers(userID, userName) {
var userInfo = [];
userInfo[0] = userID;
userInfo[1] = userName;
var cookieName = 'cUserInfo';
if ($.cookie(cookieName)) {
//need to add another row to the existing cookie
}
else {
$.cookie(cookieName, escape(userInfo .join(',')), { expires: 1 });
}
}
Please advise how to read all set of cookies as well.
Thanks in advance.