Allow setting of "secure" cookie attribute when using HTTPS. Closes #349 and #350