Added a config option to set Path attribute in Set-Cookie header.

This commit is contained in:
Zaid Abdulla committed 2014-08-07 00:48:05 +03:00
1 parent ee9a35b9b3
commit 70b0dbad29
2 files changed
+6

No files matched your search

+1
View File
@@ -49,6 +49,7 @@ options = {
SESSION_TIMEOUT : {type : 'int', default : 30}, SESSION_TIMEOUT : {type : 'int', default : 30},
GET_PARAMETER_NAMES_DEPTH_THRESHOLD : {type : 'int', default : 0}, GET_PARAMETER_NAMES_DEPTH_THRESHOLD : {type : 'int', default : 0},
TASK_PARAMETERS_BATCH_SIZE : {type : 'int', default : 32}, TASK_PARAMETERS_BATCH_SIZE : {type : 'int', default : 32},
COOKIES_PATH : {type : 'string'},
# Libxml related configuration # Libxml related configuration
XML_PARSE_RECOVER : {type : 'bool'}, XML_PARSE_RECOVER : {type : 'bool'},
+5
View File
@@ -131,7 +131,12 @@ inform = (currentRequest, cwmpRequest) ->
methodResponse : {type : 'InformResponse'}, methodResponse : {type : 'InformResponse'},
cwmpVersion : cwmpRequest.cwmpVersion cwmpVersion : cwmpRequest.cwmpVersion
}) })
if !!cookiesPath = config.get('COOKIES_PATH', currentRequest.session.deviceId)
res.headers['Set-Cookie'] = "session=#{currentRequest.sessionId}; Path=#{cookiesPath}"
else
res.headers['Set-Cookie'] = "session=#{currentRequest.sessionId}" res.headers['Set-Cookie'] = "session=#{currentRequest.sessionId}"
writeResponse(currentRequest, res) writeResponse(currentRequest, res)
) )
) )