set Secure flag on cookies if running with HTTPS

set Secure flag on cookies if running with HTTPS