{"action":"created","issue":{"url":"https://api.github.com/repos/cdnjs/cdnjs/issues/5619","labels_url":"https://api.github.com/repos/cdnjs/cdnjs/issues/5619/labels{/name}","comments_url":"https://api.github.com/repos/cdnjs/cdnjs/issues/5619/comments","events_url":"https://api.github.com/repos/cdnjs/cdnjs/issues/5619/events","html_url":"https://github.com/cdnjs/cdnjs/issues/5619","id":104923242,"number":5619,"title":"[Request] Add SessionLibrary","user":{"login":"yeisoncruz-igniweb","id":10468179,"avatar_url":"https://avatars.githubusercontent.com/u/10468179?v=3","gravatar_id":"","url":"https://api.github.com/users/yeisoncruz-igniweb","html_url":"https://github.com/yeisoncruz-igniweb","followers_url":"https://api.github.com/users/yeisoncruz-igniweb/followers","following_url":"https://api.github.com/users/yeisoncruz-igniweb/following{/other_user}","gists_url":"https://api.github.com/users/yeisoncruz-igniweb/gists{/gist_id}","starred_url":"https://api.github.com/users/yeisoncruz-igniweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yeisoncruz-igniweb/subscriptions","organizations_url":"https://api.github.com/users/yeisoncruz-igniweb/orgs","repos_url":"https://api.github.com/users/yeisoncruz-igniweb/repos","events_url":"https://api.github.com/users/yeisoncruz-igniweb/events{/privacy}","received_events_url":"https://api.github.com/users/yeisoncruz-igniweb/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cdnjs/cdnjs/labels/wait%20for%20response","name":"wait for response","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-04T16:26:28Z","updated_at":"2015-09-21T16:17:51Z","closed_at":null,"body":"\r\n**SessionLibrary:** \r\n\r\n\r\n<b>Session library without html5</b>\r\n```javascript\r\n/**\r\n * Implements cookie-less JavaScript session variables\r\n * v1.0\r\n *\r\n * By Craig Buckler, Optimalworks.net\r\n *\r\n * As featured on SitePoint.com\r\n * Please use as you wish at your own risk.\r\n*\r\n * Usage:\r\n *\r\n * // store a session value/object\r\n * Session.set(name, object);\r\n *\r\n * // retreive a session value/object\r\n * Session.get(name);\r\n *\r\n * // clear all session data\r\n * Session.clear();\r\n *\r\n * // dump session data\r\n * Session.dump();\r\n */\r\n\r\n if (JSON && JSON.stringify && JSON.parse) var Session = Session || (function() {\r\n\r\n\t// window object\r\n\tvar win = window.top || window;\r\n\r\n\t// session store\r\n\tvar store = (win.name ? JSON.parse(win.name) : {});\r\n\r\n\t// save store on page unload\r\n\tfunction Save() {\r\n\t\twin.name = JSON.stringify(store);\r\n\t};\r\n\r\n\t// page unload event\r\n\tif (window.addEventListener) window.addEventListener(\"unload\", Save, false);\r\n\telse if (window.attachEvent) window.attachEvent(\"onunload\", Save);\r\n\telse window.onunload = Save;\r\n\r\n\t// public methods\r\n\treturn {\r\n\r\n\t\t// set a session variable\r\n\t\tset: function(name, value) {\r\n\t\t\tstore[name] = value;\r\n\t\t},\r\n\r\n\t\t// get a session value\r\n\t\tget: function(name) {\r\n\t\t\treturn (store[name] ? store[name] : undefined);\r\n\t\t},\r\n\r\n\t\t// clear session\r\n\t\tclear: function() { store = {}; },\r\n\r\n\t\t// dump session data\r\n\t\tdump: function() { return JSON.stringify(store); }\r\n\r\n\t};\r\n\r\n })();\r\n```\r\n\r\nrecomended by yeisoncruz16@gmail.com\r\n=====================\r\nNotes from cdnjs maintainer:\r\nYou are welcome to add a library via sending pull request,\r\nit'll be faster then just opening a request issue,\r\nand please don't forget to read the guidelines for contributing, thanks!!"},"comment":{"url":"https://api.github.com/repos/cdnjs/cdnjs/issues/comments/142032021","html_url":"https://github.com/cdnjs/cdnjs/issues/5619#issuecomment-142032021","issue_url":"https://api.github.com/repos/cdnjs/cdnjs/issues/5619","id":142032021,"user":{"login":"yeisoncruz-igniweb","id":10468179,"avatar_url":"https://avatars.githubusercontent.com/u/10468179?v=3","gravatar_id":"","url":"https://api.github.com/users/yeisoncruz-igniweb","html_url":"https://github.com/yeisoncruz-igniweb","followers_url":"https://api.github.com/users/yeisoncruz-igniweb/followers","following_url":"https://api.github.com/users/yeisoncruz-igniweb/following{/other_user}","gists_url":"https://api.github.com/users/yeisoncruz-igniweb/gists{/gist_id}","starred_url":"https://api.github.com/users/yeisoncruz-igniweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yeisoncruz-igniweb/subscriptions","organizations_url":"https://api.github.com/users/yeisoncruz-igniweb/orgs","repos_url":"https://api.github.com/users/yeisoncruz-igniweb/repos","events_url":"https://api.github.com/users/yeisoncruz-igniweb/events{/privacy}","received_events_url":"https://api.github.com/users/yeisoncruz-igniweb/received_events","type":"User","site_admin":false},"created_at":"2015-09-21T16:17:51Z","updated_at":"2015-09-21T16:17:51Z","body":"I just to read your template to submit a lib request, but I has not repo url or package, is a little util lib for session. But if the request has not the necessary, feel free to close it."}}