       key = {offset: januaryOffset, dst: 1, hemisphere: HEMISPHERE_NORTH}
     else if januaryOffset - juneOffset > 0
       key = {offset: juneOffset, dst: 1, hemisphere: HEMISPHERE_SOUTH}
-    @set(new TimeZone("#{([key.offset, key.dst].join(','))}#{if key.hemisphere is HEMISPHERE_SOUTH then ',s' else ''}"))
+    new TimeZone("#{([key.offset, key.dst].join(','))}#{if key.hemisphere is HEMISPHERE_SOUTH then ',s' else ''}")
 
   @set: (timezone) ->
     window.timezone = timezone
-    document.cookie = "timezone=#{timezone.name}"
+    expiration = new Date()
+    expiration.setMonth(expiration.getMonth() + 1)
+    document.cookie = "timezone=#{timezone.name}; expires=#{expiration.toGMTString()}"
+    document.cookie = "timezone_offset=#{timezone.offset}"
     @callback?(timezone)
+
+  @get: ->
+    name: @getCookie('timezone')
+    offset: parseFloat(@getCookie('timezone_offset'))
+
+  @getCookie: (name) ->
+    match = document.cookie.match(new RegExp("(?:^|;)\\s?#{name}=(.*?)(?:;|$)", 'i'))
+    match && unescape(match[1])
 
   @januaryOffset: ->
     @dateOffset(new Date(2011, 0, 1, 0, 0, 0, 0))


  @parseGeoResponse: (response) =>
    delete(window[JSONP_CALLBACK])
    @set(new TimeZone(null, response.timezoneId)) if response.timezoneId

  @fallback: =>
    januaryOffset = @januaryOffset()
    juneOffset = @juneOffset()
    key = {offset: januaryOffset, dst: 0, hemisphere: HEMISPHERE_UNKNOWN}

        @name = value
        return


class Temporal

  @detect: (@username = null, @callback = null) =>
    timezone = @quick()
    if timezone.offset != @get().offset
      navigator.geolocation.getCurrentPosition(@geoSuccess, ->) if @username and navigator.geolocation
    @set(timezone)

  @geoSuccess: (position) =>
    window[JSONP_CALLBACK] = @parseGeoResponse
