HsacExamples.SlimTests.HttpTests.HttpCookieHandling


By default http test ignores 'Set-Cookie' headers (i.e. cookies received are not sent with subsequent requests).

script http test
get from https://outlook.live.com/owa/
check response status 200
show response headers
Cache-Control private
Content-Length 36433
Content-Type text/html; charset=utf-8
Set-Cookie [ClientId=8842F1B45C8C4E98962DC5A3F73DA51A; expires=Tue, 16-Mar-2021 08:31:16 GMT; path=/;SameSite=None; secure, ClientId=8842F1B45C8C4E98962DC5A3F73DA51A; expires=Tue, 16-Mar-2021 08:31:16 GMT; path=/;SameSite=None; secure, RoutingKeyCookie=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure, HostSwitchPrg=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure, OptInPrg=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure, logonLatency=LGN01=637199442762943846; domain=live.com; path=/; secure; HttpOnly, O365Consumer=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure]
request-id 66df723e-2ca7-442e-a705-dba194aca151
X-CalculatedFETarget DM5PR19CU002.internal.outlook.com
X-BackEndHttpStatus [200, 200]
X-FEProxyInfo DM5PR19CA0045.NAMPRD19.PROD.OUTLOOK.COM
X-CalculatedBETarget DM5PR1401MB2090.namprd14.prod.outlook.com
X-RUM-Validated 1
X-Content-Type-Options nosniff
X-BeSku Gen9
X-BackEnd-Begin 2020-03-16T08:31:16.290
X-BackEnd-End 2020-03-16T08:31:16.305
X-DiagInfo DM5PR1401MB2090
X-BEServer DM5PR1401MB2090
X-UA-Compatible IE=EmulateIE7
Strict-Transport-Security [max-age=31536000; includeSubDomains, max-age=31536000; includeSubDomains]
X-Proxy-RoutingCorrectness 1
X-Proxy-BackendServerStatus 200
X-FEServer [DM5PR19CA0045, CH2PR14CA0015]
X-MSEdge-Ref Ref A: 00D78E5A0DA94BC1839157A0220514FC Ref B: CHGEDGE1513 Ref C: 2020-03-16T08:31:16Z
Date Mon, 16 Mar 2020 08:31:15 GMT
note By default cookies are not stored
check cookie value ClientId null
$setCookie<-[[ClientId=8842F1B45C8C4E98962DC5A3F73DA51A; expires=Tue, 16-Mar-2021 08:31:16 GMT; path=/;SameSite=None; secure, ClientId=8842F1B45C8C4E98962DC5A3F73DA51A; expires=Tue, 16-Mar-2021 08:31:16 GMT; path=/;SameSite=None; secure, RoutingKeyCookie=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure, HostSwitchPrg=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure, OptInPrg=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure, logonLatency=LGN01=637199442762943846; domain=live.com; path=/; secure; HttpOnly, O365Consumer=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure]] response header Set-Cookie

script list fixture
check size of $setCookie->[[ClientId=8842F1B45C8C4E98962DC5A3F73DA51A; expires=Tue, 16-Mar-2021 08:31:16 GMT; path=/;SameSite=None; secure, ClientId=8842F1B45C8C4E98962DC5A3F73DA51A; expires=Tue, 16-Mar-2021 08:31:16 GMT; path=/;SameSite=None; secure, RoutingKeyCookie=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure, HostSwitchPrg=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure, OptInPrg=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure, logonLatency=LGN01=637199442762943846; domain=live.com; path=/; secure; HttpOnly, O365Consumer=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure]] 7>1
show value at 2 in $setCookie->[[ClientId=8842F1B45C8C4E98962DC5A3F73DA51A; expires=Tue, 16-Mar-2021 08:31:16 GMT; path=/;SameSite=None; secure, ClientId=8842F1B45C8C4E98962DC5A3F73DA51A; expires=Tue, 16-Mar-2021 08:31:16 GMT; path=/;SameSite=None; secure, RoutingKeyCookie=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure, HostSwitchPrg=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure, OptInPrg=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure, logonLatency=LGN01=637199442762943846; domain=live.com; path=/; secure; HttpOnly, O365Consumer=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure]] RoutingKeyCookie=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure

By setting 'store cookies' to 'true' we can ensure cookies are stored, and sent with subsequent requests.

script http test
set store cookies true
get from https://outlook.live.com/owa/
check response status 200
show response headers
Cache-Control private
Content-Length 36433
Content-Type text/html; charset=utf-8
Set-Cookie [ClientId=321D607B2C2C47F6BE6F384B07AE0688; expires=Tue, 16-Mar-2021 08:31:16 GMT; path=/;SameSite=None; secure, ClientId=321D607B2C2C47F6BE6F384B07AE0688; expires=Tue, 16-Mar-2021 08:31:16 GMT; path=/;SameSite=None; secure, RoutingKeyCookie=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure, HostSwitchPrg=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure, OptInPrg=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure, logonLatency=LGN01=637199442764256666; domain=live.com; path=/; secure; HttpOnly, O365Consumer=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure]
request-id 998df4ff-97da-4bf2-a97d-0a419ff45f97
X-CalculatedFETarget MN2PR07CU001.internal.outlook.com
X-BackEndHttpStatus [200, 200]
X-FEProxyInfo MN2PR07CA0016.NAMPRD07.PROD.OUTLOOK.COM
X-CalculatedBETarget MN2PR10MB3534.namprd10.prod.outlook.com
X-RUM-Validated 1
X-Content-Type-Options nosniff
X-BeSku WCS5
X-BackEnd-Begin 2020-03-16T08:31:16.424
X-BackEnd-End 2020-03-16T08:31:16.441
X-DiagInfo MN2PR10MB3534
X-BEServer MN2PR10MB3534
X-UA-Compatible IE=EmulateIE7
Strict-Transport-Security [max-age=31536000; includeSubDomains, max-age=31536000; includeSubDomains]
X-Proxy-RoutingCorrectness 1
X-Proxy-BackendServerStatus 200
X-FEServer [MN2PR07CA0016, CH2PR10CA0018]
X-MSEdge-Ref Ref A: CA2917A45B26436CB30F55574B602224 Ref B: CHGEDGE1418 Ref C: 2020-03-16T08:31:16Z
Date Mon, 16 Mar 2020 08:31:15 GMT
show cookie values
ClientId 321D607B2C2C47F6BE6F384B07AE0688
logonLatency LGN01=637199442764256666
check not cookie value ClientId null
get from https://outlook.live.com/owa/
check response status 200
show response headers
Cache-Control private
Content-Length 36433
Content-Type text/html; charset=utf-8
Set-Cookie [RoutingKeyCookie=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure, HostSwitchPrg=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure, OptInPrg=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure, logonLatency=LGN01=637199442765435075; domain=live.com; path=/; secure; HttpOnly, O365Consumer=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure]
request-id 1674ebbb-41bc-4b4d-a836-f22de4f69416
X-CalculatedFETarget MN2PR01CU002.internal.outlook.com
X-BackEndHttpStatus [200, 200]
X-FEProxyInfo MN2PR01CA0054.PROD.EXCHANGELABS.COM
X-CalculatedBETarget MN2PR17MB3774.namprd17.prod.outlook.com
X-RUM-Validated 1
X-Content-Type-Options nosniff
X-BeSku WCS6
X-BackEnd-Begin 2020-03-16T08:31:16.542
X-BackEnd-End 2020-03-16T08:31:16.551
X-DiagInfo MN2PR17MB3774
X-BEServer MN2PR17MB3774
X-UA-Compatible IE=EmulateIE7
Strict-Transport-Security [max-age=31536000; includeSubDomains, max-age=31536000; includeSubDomains]
X-Proxy-RoutingCorrectness 1
X-Proxy-BackendServerStatus 200
X-FEServer [MN2PR01CA0054, CH2PR17CA0016]
X-MSEdge-Ref Ref A: 1A25B9E09CA54F0E9CFEF77555E2BA6C Ref B: CHGEDGE1109 Ref C: 2020-03-16T08:31:16Z
Date Mon, 16 Mar 2020 08:31:16 GMT
show cookie values
ClientId 321D607B2C2C47F6BE6F384B07AE0688
logonLatency LGN01=637199442765435075
check not cookie value ClientId null
clear cookies
get from https://outlook.live.com/owa/
check response status 200
show response headers
Cache-Control private
Content-Length 36433
Content-Type text/html; charset=utf-8
Set-Cookie [ClientId=6EE24ED39F22486986B827A946E45133; expires=Tue, 16-Mar-2021 08:31:16 GMT; path=/;SameSite=None; secure, ClientId=6EE24ED39F22486986B827A946E45133; expires=Tue, 16-Mar-2021 08:31:16 GMT; path=/;SameSite=None; secure, RoutingKeyCookie=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure, HostSwitchPrg=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure, OptInPrg=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure, logonLatency=LGN01=637199442766327518; domain=live.com; path=/; secure; HttpOnly, O365Consumer=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure]
request-id bd22f0fa-7485-4801-a4d7-5085943f6200
X-CalculatedFETarget BN6PR10CU001.internal.outlook.com
X-BackEndHttpStatus [200, 200]
X-FEProxyInfo BN6PR10CA0020.NAMPRD10.PROD.OUTLOOK.COM
X-CalculatedBETarget BN8PR14MB4212.NAMPRD14.PROD.OUTLOOK.COM
X-RUM-Validated 1
X-Content-Type-Options nosniff
X-BeSku WCS6
X-BackEnd-Begin 2020-03-16T08:31:16.630
X-BackEnd-End 2020-03-16T08:31:16.640
X-DiagInfo BN8PR14MB4212
X-BEServer BN8PR14MB4212
X-UA-Compatible IE=EmulateIE7
Strict-Transport-Security [max-age=31536000; includeSubDomains, max-age=31536000; includeSubDomains]
X-Proxy-RoutingCorrectness 1
X-Proxy-BackendServerStatus 200
X-FEServer [BN6PR10CA0020, CH2PR14CA0056]
X-MSEdge-Ref Ref A: 9CE59D8D64DB4CDC892C26FE3436079A Ref B: CHGEDGE1509 Ref C: 2020-03-16T08:31:16Z
Date Mon, 16 Mar 2020 08:31:16 GMT
show cookie values
ClientId 6EE24ED39F22486986B827A946E45133
logonLatency LGN01=637199442766327518
check not cookie ClientId value null
check cookie ClientId domain outlook.live.com
check cookie ClientId path /
ensure cookie ClientId is persistent
ensure cookie ClientId is secure
reject cookie ClientId is http only
check cookie ClientId attribute HTTPOnly null
check cookie ClientId attribute doesNotExist null

If we set 'store cookies' to 'false' cookies are no longer stored.

script
set store cookies false
get from https://outlook.live.com/owa/
check response status 200
show response headers
Cache-Control private
Content-Length 36433
Content-Type text/html; charset=utf-8
Set-Cookie [RoutingKeyCookie=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure, HostSwitchPrg=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure, OptInPrg=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure, logonLatency=LGN01=637199442767692942; domain=live.com; path=/; secure; HttpOnly, O365Consumer=; expires=Fri, 16-Mar-1990 08:31:16 GMT; path=/; secure]
request-id 63949cdd-6e92-4db2-9075-1aac24e50f6d
X-CalculatedFETarget BN6PR14CU001.internal.outlook.com
X-BackEndHttpStatus [200, 200]
X-FEProxyInfo BN6PR14CA0009.NAMPRD14.PROD.OUTLOOK.COM
X-CalculatedBETarget BN6PR10MB1537.namprd10.prod.outlook.com
X-RUM-Validated 1
X-Content-Type-Options nosniff
X-BeSku Gen9
X-BackEnd-Begin 2020-03-16T08:31:16.768
X-BackEnd-End 2020-03-16T08:31:16.775
X-DiagInfo BN6PR10MB1537
X-BEServer BN6PR10MB1537
X-UA-Compatible IE=EmulateIE7
Strict-Transport-Security [max-age=31536000; includeSubDomains, max-age=31536000; includeSubDomains]
X-Proxy-RoutingCorrectness 1
X-Proxy-BackendServerStatus 200
X-FEServer [BN6PR14CA0009, CH2PR10CA0007]
X-MSEdge-Ref Ref A: 52F59423C20742488C84C0F32063478A Ref B: CHGEDGE1014 Ref C: 2020-03-16T08:31:16Z
Date Mon, 16 Mar 2020 08:31:16 GMT
check cookie value ClientId null