Sha256: ea3675eeb8e64e5b729252efa8b63bf587d40e854fcf238b7ec7b404d0574024
Contents?: true
Size: 626 Bytes
Versions: 4
Compression:
Stored size: 626 Bytes
Contents
class @Cookie @set: (name, value, exdays=null)-> exdate = new Date() exdate.setDate(exdate.getDate() + exdays) value = "#{escape(value)}; path=/" value += "; expires=#{exdate.toUTCString()}" if exdays value += "; domain=.#{BASE_DOMAIN}" if BASE_DOMAIN and URL.parse(window.location.href).root_domain != '0.0' document.cookie = "#{name}=#{value}" @get: (name)-> cookies = document.cookie.split(";") for cookie in cookies x = cookie.substr(0,cookie.indexOf("=")) y = cookie.substr(cookie.indexOf("=")+1) x = x.replace(/^\s+|\s+$/g,"") return unescape(y) if (x==name)
Version data entries
4 entries across 4 versions & 1 rubygems