search

Home  >  Q&A  >  body text

node.js - expressr获取不到cookie的expires信息,如何获取cookie的expires信息

前提是子站服务器端使用express搭建,浏览器端存有主站的cookie信息。访问子站时,子站服务器端能够获取到cookie的key=value信息,但是获取不到cookie的expires或者max-age信息。
在主站的java服务器上可以获取cookie全部信息,所以比较疑惑,在express上如何获取cookie的全部信息?

PHPzPHPz2783 days ago729

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 15:01:42

    How do you get it on the Java main site? It is not possible. The http protocol will only send key-value pair information without expired cookies. Other messages will not be sent back. In Java's servlet api, Cookie.getMaxAge always returns -1. The same goes for the others. This is determined by the http protocol itself and has nothing to do with any framework or language.

    reply
    0
  • Cancelreply