由于Cookies是我们浏览的网站传输到用户计算机硬盘中的文本文件或内存中的数据,因此它在硬盘中存放的位置与使用的操作系统和浏览器密切相关。在Windows 9X系统计算机中,Cookies文件的存放位置为C:/Windows/Cookies,在Windows NT/2000/XP的计算机中,Cookies文件的存放位置为C:/Documents and Settings/用户名/Cookies。
/**
* Configures the given JSESSIONID cookie.
*
* @param cookie The JSESSIONID cookie to be configured
*/
protected void configureSessionCookie(Cookie cookie) {
…
}
HttpSession doGetSession(boolean create){
…
// Creating a new session cookie based on that session
if ((session != null) && (getContext() != null)
&& getContext().getCookies()) {
Cookie cookie = new Cookie(Globals.SESSION_COOKIE_NAME,
session.getId());
configureSessionCookie(cookie);
((HttpServletResponse) response).addCookie(cookie);
}
…
}