Correct handling of HTTPS cookies

 - Use the same protocol as the page you're on, instead of assuming http

Signed-off-by: Mansour Behabadi <mansour@oxplot.com>