From 71ae70f6700335eade274b107f2f82da8acce05c Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Thu, 15 Mar 2012 10:43:29 +0000 Subject: [PATCH] added: to cookies: flag "; secure" if a connection is through SSL git-svn-id: svn://ttmath.org/publicrep/winix/trunk@821 e52654a7-88a9-db11-a3e9-0013d4bc506e --- core/request.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/request.cpp b/core/request.cpp index 3bc5ffd..73f3d6e 100755 --- a/core/request.cpp +++ b/core/request.cpp @@ -114,7 +114,12 @@ void Request::SetCookie(const char * name, const char * value, tm * expires) if( expires ) headers << "; expires=" << DateToStrCookie(expires) << " GMT"; - headers << "; path=/; domain=" << config->base_url << "\r\n"; + headers << "; path=/; domain=" << config->base_url; + + if( using_ssl ) + headers << "; secure"; + + headers << "\r\n"; } @@ -126,7 +131,12 @@ void Request::SetCookie(const char * name, long value, tm * expires) if( expires ) headers << "; expires=" << DateToStrCookie(expires) << " GMT"; - headers << "; path=/; domain=" << config->base_url << "\r\n"; + headers << "; path=/; domain=" << config->base_url; + + if( using_ssl ) + headers << "; secure"; + + headers << "\r\n"; }