Are you really trying to program
servlets without having the servlet API on hand? The cookie constructor takes a String name and a String value.
Cookies have a name and a single value, so you can either make separate cookies for name and for password, or come up with a way to combine name and password in a single String. If you do a setValue on a cookie, the new value replaces the old one.
Bill