Removed any hard-coded reference to 'http:', replaced with window.location.protocol.  Made cookies expire in 14 days, updated cookies to use secure cookies if the protocol is https (stop-gap until they're converted to use localStorage)