I am using YouTrack for our tracking system. Youtrack comes with a rest webservice that you can call to get information from the system. I am having problem getting authoriz
Try this:
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
$.post(youTrackLoginUrl, { login: "restUser", password: "qwerty" }, function(data, text, xhr) {
data_set_cookie = data.match(/Set-Cookie:\s([^;]+);/)[1];
createCookie(data_set_cookie.split("=")[0],data_set_cookie.split("=")[1],365); //sets cookie for 1 year
});