Adds 'secure' property to 'token' cookie

This patch adds 'secure' property to 'token' cookie if the protocol
is https. The 'secure' property is left empty for http connections.