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
This commit is contained in:
Tomasz Sowa 2012-03-15 10:43:29 +00:00
parent b1b3cea64e
commit 71ae70f670
1 changed files with 12 additions and 2 deletions

View File

@ -114,7 +114,12 @@ void Request::SetCookie(const char * name, const char * value, tm * expires)
if( expires ) if( expires )
headers << "; expires=" << DateToStrCookie(expires) << " GMT"; 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 ) if( expires )
headers << "; expires=" << DateToStrCookie(expires) << " GMT"; 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";
} }