Added a settings flag to allow secure cookies