Skip to content

Commit 20cdbf5

Browse files
authored
Add exception for set-cookie headers to always append (#589)
1 parent 01d8ef1 commit 20cdbf5

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

system/web/context/RequestContext.cfc

+10-3
Original file line numberDiff line numberDiff line change
@@ -1803,9 +1803,16 @@ component serializable="false" accessors="true" {
18031803
}
18041804
// Name Exists and not already set.
18051805
else if ( !isNull( arguments.name ) ) {
1806-
getPageContext()
1807-
.getResponse()
1808-
.setHeader( javacast( "string", arguments.name ), javacast( "string", arguments.value ) );
1806+
1807+
var response = getPageContext().getResponse();
1808+
1809+
// special exception for Set-Cookie. We always append this header, instead of overwriting
1810+
if ( arguments.name == "Set-Cookie" ) {
1811+
response.addHeader( javacast( "string", arguments.name ), javacast( "string", arguments.value ) );
1812+
} else {
1813+
response.setHeader( javacast( "string", arguments.name ), javacast( "string", arguments.value ) );
1814+
}
1815+
18091816
variables.responseHeaders[ arguments.name ] = arguments.value;
18101817
} else {
18111818
throw(

0 commit comments

Comments
 (0)