First of all I don't think that storing username and password client side in a cookie is a good idea. Instead you could use session token stored in cookie to verify if user is logged in. Secondly you can use one function to get value of cookie based on it's name. Writing one function i.e. getCookieVal( nameParameter ) could return proper value - saves time and is not so prone to error.
But, let's get to the point. You need to use json notation to pass js object do data, like this:
data : { you_wrote_1 : YouWrote , you_wrote_2: YouWrote2 }
That's it. You can then grab these variables on the server using $_POST table - with php.