From 70421b7bd13261b7f4b2317dd764349def933687 Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Thu, 15 Mar 2012 17:50:19 +0000 Subject: [PATCH] reverted last commit (secure flag to cookie) with some info git-svn-id: svn://ttmath.org/publicrep/winix/trunk@822 e52654a7-88a9-db11-a3e9-0013d4bc506e --- core/request.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/core/request.cpp b/core/request.cpp index 73f3d6e..802c625 100755 --- a/core/request.cpp +++ b/core/request.cpp @@ -114,12 +114,15 @@ void Request::SetCookie(const char * name, const char * value, tm * expires) if( expires ) headers << "; expires=" << DateToStrCookie(expires) << " GMT"; - headers << "; path=/; domain=" << config->base_url; + headers << "; path=/; domain=" << config->base_url << "\r\n"; - if( using_ssl ) - headers << "; secure"; - - headers << "\r\n"; + /* + don't use '; secure' flag if you are using both sites (with SSL + and without SSL) -- with secure flag the cookie is sent only through + SSL and if you accidentally open a new window without SSL (http://) + then winix will create a new session for you and the previous session (https://) + will be lost (cookie is overwritten on the client browser) + */ } @@ -131,12 +134,7 @@ void Request::SetCookie(const char * name, long value, tm * expires) if( expires ) headers << "; expires=" << DateToStrCookie(expires) << " GMT"; - headers << "; path=/; domain=" << config->base_url; - - if( using_ssl ) - headers << "; secure"; - - headers << "\r\n"; + headers << "; path=/; domain=" << config->base_url << "\r\n"; }