when request a js file ,why browers will add a param sessionid in http head cookie
below is the example
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset GB2312,utf-8;q=0.7,*;q=0.7
Accept-Encoding gzip, deflate
Accept-Language zh-cn,zh;q=0.5
Connection keep-alive
Cookie JSESSIONID=A87429B9EB1AB5E8FFEEF62B2149ED48
Host localhost:8080
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:6.0.2) Gecko/20100101 Firefox/6.0.2
thanks
It has nothing to do with the file being js or otherwise.
Cookies apply to all resources that match their path.
The server may or may not care about the session data when it generates it’s response.
Keeping static resources on a different host to which the cookies are not sent is one technique used to boost performance when fetching them. (There are other performance optimisations that can be applied at the same time, such as the use of a CDN to provide geographically local resources).