{"action":"created","issue":{"url":"https://api.github.com/repos/cupools/cupools.github.io/issues/1","labels_url":"https://api.github.com/repos/cupools/cupools.github.io/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/cupools/cupools.github.io/issues/1/comments","events_url":"https://api.github.com/repos/cupools/cupools.github.io/issues/1/events","html_url":"https://github.com/cupools/cupools.github.io/issues/1","id":119056874,"number":1,"title":"关于设置cookie的一个建议","user":{"login":"AceLing","id":7394322,"avatar_url":"https://avatars.githubusercontent.com/u/7394322?v=3","gravatar_id":"","url":"https://api.github.com/users/AceLing","html_url":"https://github.com/AceLing","followers_url":"https://api.github.com/users/AceLing/followers","following_url":"https://api.github.com/users/AceLing/following{/other_user}","gists_url":"https://api.github.com/users/AceLing/gists{/gist_id}","starred_url":"https://api.github.com/users/AceLing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AceLing/subscriptions","organizations_url":"https://api.github.com/users/AceLing/orgs","repos_url":"https://api.github.com/users/AceLing/repos","events_url":"https://api.github.com/users/AceLing/events{/privacy}","received_events_url":"https://api.github.com/users/AceLing/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-26T14:42:06Z","updated_at":"2015-11-27T06:30:39Z","closed_at":null,"body":"几个好用的函数\r\nfunction setCookie(c_name, value, expiredays) {\r\n    var exdate = new Date();\r\n    exdate.setDate(exdate.getDate() + expiredays);\r\n    document.cookie = c_name + '=' + window.escape(value) + ((!expiredays) ? '' : ';expires=' + exdate.toGMTString());\r\n}\r\n\r\nsetDate是设置当前月的某一日，由本月到下月时，会出现问题，建议使用setTime"},"comment":{"url":"https://api.github.com/repos/cupools/cupools.github.io/issues/comments/160052343","html_url":"https://github.com/cupools/cupools.github.io/issues/1#issuecomment-160052343","issue_url":"https://api.github.com/repos/cupools/cupools.github.io/issues/1","id":160052343,"user":{"login":"AceLing","id":7394322,"avatar_url":"https://avatars.githubusercontent.com/u/7394322?v=3","gravatar_id":"","url":"https://api.github.com/users/AceLing","html_url":"https://github.com/AceLing","followers_url":"https://api.github.com/users/AceLing/followers","following_url":"https://api.github.com/users/AceLing/following{/other_user}","gists_url":"https://api.github.com/users/AceLing/gists{/gist_id}","starred_url":"https://api.github.com/users/AceLing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AceLing/subscriptions","organizations_url":"https://api.github.com/users/AceLing/orgs","repos_url":"https://api.github.com/users/AceLing/repos","events_url":"https://api.github.com/users/AceLing/events{/privacy}","received_events_url":"https://api.github.com/users/AceLing/received_events","type":"User","site_admin":false},"created_at":"2015-11-27T06:30:38Z","updated_at":"2015-11-27T06:30:38Z","body":"使用toGMTString(), toUTCString()的兼容性问题\r\n设置expires的时候\r\nchrome：expires = 代码设置的时间 +- 时差\r\nfirefox：expires = 代码设置的时间\r\n\r\n关于时差：由于国内是东八区，所以与UTC标准相差+8小时"}}