Added support for httponly and secure flags. Also did some formatting.