You really have to force a redirect from HTTP to HTTPS from the server, since doing this from the client does not add any real security.
Think about it, the user downloaded the application into his browser from an insecure endpoint, and from that moment nothing can be trusted. Even server redirection is problematic because it relies on recommendations for redirection from an untrusted endpoint. Users must really access things from their initial trusted starting point, otherwise all bets will be disabled. This is called a secure referral problem and will probably never be resolved due to the business model behind SSL certificates.
You also should not trust cookies from an untrusted HTTP domain in a trusted HTTPS domain unless you can authenticate these cookies on the client. The exchange of cookies between HTTP / HTTPS is described in RFC 2109 (section 4.2.2 Set-Cookie Syntax).
It means:
- A set of cookies with "Safe" will be available only on HTTPS
- A cookie set without "Secure" will be available on HTTP or HTTPS.
source share