是否可以从javascript检索现有cookie的创建或过期日期?如果是这样的话?
我在这里已经阅读了很多jQuery cookie问题,并且知道有一个jQuery cookie插件(jQuery cookie).没有做太多调查,问题是:有没有办法确定cookie的到期日期?
来自jquery.cookie doc:
/**
* Get the value of a cookie with the given name.
*
* @example $.cookie('the_cookie');
* @desc Get the value of a cookie.
*
* @param String name The name of the cookie.
* @return The value of the cookie.
* @type String
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/klaus.hartl@stilbuero.de
*/
Run Code Online (Sandbox Code Playgroud)
这个插件似乎不能做到吗?
我想这样做的原因是我的cookie在5分钟不活动后过期,并且我想通知用户他们的会话即将从Javascript到期.