2013-08-27 60 views
1

我正在使用nsICookie2通過firefox爲android擴展獲取存在的cookie。當我展示餅乾和它們的屬性我發現了一些很奇怪的名單,到期時間總是遜色於創建和上次訪問的時間,EXP:cookies的創建時間,過期時間,最後加入時間

host.bluekai.com expires on 1393031459 time now 1377624200429 cookie creation time 1377479134953422 cookie lasAccessed 1377481998001732 

,並在我的代碼,我寫了這個:

" host"+coo.host+" expires on "+coo.expiry+" time now "+dd.getTime()+" cookie creationTime "+coo.creationTime+" cookie lastAccessed "+coo.lastAccessed+" \n"; 

任何人都可以給我一個合理的解釋嗎?

回答

0

不是。一個是在幾秒鐘內,在微秒的人,你就需要規模:

1393031459 > (1377624200429/1000) 

nsICookie2:

/** 
* the actual expiry time of the cookie, in seconds 
* since midnight (00:00:00), January 1, 1970 UTC. 
* 
* this is distinct from nsICookie::expires, which 
* has different and obsolete semantics. 
*/ 
readonly attribute int64_t expiry; 

/** 
* the creation time of the cookie, in microseconds 
* since midnight (00:00:00), January 1, 1970 UTC. 
*/ 
readonly attribute int64_t creationTime; 

/** 
* the last time the cookie was accessed (i.e. created, 
* modified, or read by the server), in microseconds 
* since midnight (00:00:00), January 1, 1970 UTC. 
* 
* note that this time may be approximate. 
*/ 
readonly attribute int64_t lastAccessed; 

誠然,這是相當混亂使用不同的時間單位。 :p

+0

現在,它使sens,我沒有注意到差異。謝謝nmaier。 – user2102196