Back to product page

Cookies property (HttpResponse)


Holds response cookies.

Type

A HttpCookies object

Syntax

  • Basic
object.Cookies
The Cookies(object) syntax has these parts:
objectAn expression evaluating to an object of type HttpResponse.

Remarks

This property will read and return collection of all cookies that will be sent to the server. It is created first time you access it by reading headers collection from Response object, and populating it with 'Cookie' headers. Those headers are removed from collection of headers, parsed, and put into cookies collection.

Each cookie has its Name and its Value, and possibly few Attributes describing the cookie, such as Path, Expiry date etc..

To copy cookies from previous response to new request, you can use this simple code:
 
Dim oldcookie As HttpCookie
For Each oldcookie In Http1.Response.Cookies
   Http1.Request.Cookies.Add oldcookie.Name, oldcookie.Value
Next
 


Platforms

Windows