我通过子域在我的应用程序上提供所有静态内容。
但是,我的快速应用程序仍在静态内容上设置会话 cookie。我尝试按照文档设置这样的路径:
app.use(express.session({
secret: 'your app secret',
cookie: {
domain : '.yourdomain.com'
},
store: new MongoStore({
db: 'db',
host: 'localhost',
port:config.dbPort
})
}));
但它仍然对我不起作用。我也尝试使用 'path' :
cookie: {
path : '.yourdomain.com'
}
但即使这样也不能阻止在静态内容上设置 cookie。
关于如何从所有静态内容中删除 cookie 的任何想法?
更新:
Request Headers
Accept:text/css,*/*;q=0.1
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Host:cdn.yourdomain.com
Referer:http://localhost:8888/
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.52 Safari/536.5
Response Headers
Cache-Control:public, max-age=86400
Connection:keep-alive
Content-Encoding:gzip
Content-Type:text/css; charset=UTF-8
Date:Mon, 28 May 2012 09:02:09 GMT
Last-Modified:Tue, 01 May 2012 03:57:45 GMT
Server:nginx
Set-Cookie:connect.sid=d9nEPGiAeSwGFUN2Ra8CGBmq.tPdTQdk7O2UUvO2q%2BEOG2%2Fgh%2FNEdIxtUZYdUN%2FtDmas; domain=www.yourdomain.com; path=/; expires=Mon, 28 May 2012 13:02:08 GMT; httpOnly
Transfer-Encoding:chunked
X-Cache:MISS
X-Edge-Id:353260802