cookie 保存值问题

cookie中,看书和看网上资料都显示同时可以保存多个属性,只要用分号加空格即可。
这种形式:
document.cookie="userId=828; userName=hulk";

不经意间自己测试了一下,结果发现这样写,第二个属性竟然保存不了,下面这种方式可以保存。
document.cookie="userId=222";
document.cookie="username=ssg";

为什么呢?

用的浏览器是ie8

我摘录的话来自MDC
https://developer.mozilla.org/en/DOM/document.cookie
在w3的标准http://www.w3.org/TR/html5/dom.html#dom-document-cookie
是这么说的:
Can be set, to add a new cookie to the element's set of HTTP cookies.

document.cookie的setter并不是一个单纯的赋值,或者说document.cookie不是一个value property,而是一个accessor property
accessor property有点类似C#里的property,其get和set是对应着另一个函数的,因此document.cookie = 'a=b;c=d';相当于调用了某个函数document.set_cookie_internal('a=b;c=d');这个函数里有任何的处理都是很正常的

另外,标准也已经明确说了:
document.cookie = updatedCookie;
updatedCookie is a string of form key=value. Note that you can only set/update a single cookie at a time using this method.
一次只能设一个值,所以还是按标准来做吧