Added support for secure cookies