2014-03-25 82 views
1

我不確定下面有兩個餅乾propertysession & storeId)。如何分配它們以及如何爲它們設置值。瞭解一些餅乾「參數」

{ 
    "domain": "localhost", 
    "expirationDate": 1395835493.034348, 
    "hostOnly": true, 
    "httpOnly": true, 
    "name": "token", 
    "path": "/", 
    "secure": false, 
    "session": false, /* What does session option mean here & how to assign them. */ 
    "storeId": "0",  /* What does storeId mean here & how to assign them. */ 
    "value": "6e5ef234b7f34fd265f011ab80fc0cff" 
} 

我知道休息cookie property,只是不是session & storeId清楚。

有人可以請解釋。

謝謝

回答

2

我想你是用鉻擴展API來打印這個信息。

cookie的storeid和session屬性將歸因於Chrome擴展API。 RFC的RFC沒有這些。

session - 如果cookie是會話cookie,則爲true,與持有到期日期的cookie不同。
storeId - 包含此cookie的cookie存儲的ID,如getAllCookieStores()中所提供。

來源: https://developer.chrome.com/extensions/cookies

更新:忽略到期價值將使其成爲一個會話cookie。 Create a cookie that lasts until the browser is closed(Session Cookie?)

+0

如何將'cookie'設置爲'session cookie'? –

+1

忽略過期值將使其成爲會話cookie。 http://stackoverflow.com/questions/5670419/create-a-cookie-that-lasts-until-the-browser-is-closedsession-cookie –

+0

謝謝,這清除了我的懷疑。 –