DCL 3.7.4
Loading...
Searching...
No Matches
HttpSetCookie Class Reference

#include <HttpHeader.h>

Inheritance diagram for HttpSetCookie:
HttpHeader

Public Member Functions

 HttpSetCookie (const wchar_t *_name, const wchar_t *_value=NULL, time_t _expires=0, const wchar_t *_path=NULL, const wchar_t *_domain=NULL, bool _secure=false)
Public Member Functions inherited from HttpHeader
 HttpHeader ()
 HttpHeader (const HttpHeader &src)
 HttpHeader (const wchar_t *_name, const wchar_t *_content=NULL)
const String & name () const
const String & content () const
String toString () const

Additional Inherited Members

Protected Attributes inherited from HttpHeader
String __name
String __content

Detailed Description

Definition at line 34 of file HttpHeader.h.

Constructor & Destructor Documentation

◆ HttpSetCookie()

HttpSetCookie::HttpSetCookie ( const wchar_t * _name,
const wchar_t * _value = NULL,
time_t _expires = 0,
const wchar_t * _path = NULL,
const wchar_t * _domain = NULL,
bool _secure = false )

Definition at line 98 of file HttpHeader.cpp.

105 : HttpHeader(L"Set-Cookie")
106{
107 __DCL_ASSERT(_name != NULL);
108
109 StringBuilder sb = _name;
110 sb += L"=";
111 if (_value == NULL) {
112 // MSIE에서 null-value를 가지는 쿠키를 지우지 못한다
113 // 1년 1초 전의 시간을 할당하여 쿠키를 삭제한다.
114 sb += L"deleted";
115 sb += L"; Expires=";
116 sb += __GetGmtStr(time(NULL) - 31536001);
117 }
118 else {
119 sb += _value;
120 if (_expires > 0) {
121 sb += L"; Expires=";
122 sb += __GetGmtStr(_expires);
123 }
124 if (_path) {
125 sb += L"; Path=";
126 sb += _path;
127 }
128 if (_domain) {
129 sb += L"; Domain=";
130 sb += _domain;
131 }
132 if (_secure) {
133 sb += L"; Secure";
134 }
135 }
136
137 __content = sb.toString();
138}
#define NULL
Definition Config.h:312
#define __DCL_ASSERT(expr)
Definition Object.h:394
String __content
Definition HttpHeader.h:24

The documentation for this class was generated from the following files: