Add option for secure cookies

Checks if the current page is https, and if so, sets the secure option on the cookies.