From c6fbe6740abdda4e05cb28c06b8255b57277b15c Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Sun, 20 Nov 2011 11:52:31 -0500 Subject: [PATCH] i forgot secure cookie param! --- cgi.d | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cgi.d b/cgi.d index 8777cf8..56a21c6 100644 --- a/cgi.d +++ b/cgi.d @@ -726,7 +726,7 @@ class Cgi { /// expiresIn is how many milliseconds in the future the cookie will expire. /// TIP: to make a cookie accessible from subdomains, set the domain to .yourdomain.com. /// Note setCookie() must be called *before* you write() any data to the output. - void setCookie(string name, string data, long expiresIn = 0, string path = null, string domain = null, bool httpOnly = false) { + void setCookie(string name, string data, long expiresIn = 0, string path = null, string domain = null, bool httpOnly = false, bool secure = false) { assert(!outputtedResponseData); string cookie = name ~ "="; cookie ~= data; @@ -736,6 +736,8 @@ class Cgi { cookie ~= "; expires=" ~ printDate(cast(DateTime) Clock.currTime + dur!"msecs"(expiresIn)); if(domain !is null) cookie ~= "; domain=" ~ domain; + if(secure == true) + cookie ~= "; Secure"; if(httpOnly == true ) cookie ~= "; HttpOnly";