### YamlMime:JavaType
uid: "com.azure.core.http.policy.CookiePolicy"
fullName: "com.azure.core.http.policy.CookiePolicy"
name: "CookiePolicy"
nameWithType: "CookiePolicy"
summary: "The `CookiePolicy` class is an implementation of the interface."
inheritances:
- ""
inheritedClassMethods:
- classRef: "java.lang.Object"
methodsRef:
- "clone"
- "equals"
- "finalize"
- "getClass"
- "hashCode"
- "notify"
- "notifyAll"
- "toString"
- "wait"
- "wait"
- "wait"
syntax: "public class **CookiePolicy** implements "
constructors:
- uid: "com.azure.core.http.policy.CookiePolicy.CookiePolicy()"
fullName: "com.azure.core.http.policy.CookiePolicy.CookiePolicy()"
name: "CookiePolicy()"
nameWithType: "CookiePolicy.CookiePolicy()"
summary: "Creates a new instance of ."
syntax: "public CookiePolicy()"
desc: "Creates a new instance of ."
methods:
- uid: "com.azure.core.http.policy.CookiePolicy.process(com.azure.core.http.HttpPipelineCallContext,com.azure.core.http.HttpPipelineNextPolicy)"
fullName: "com.azure.core.http.policy.CookiePolicy.process(HttpPipelineCallContext context, HttpPipelineNextPolicy next)"
name: "process(HttpPipelineCallContext context, HttpPipelineNextPolicy next)"
nameWithType: "CookiePolicy.process(HttpPipelineCallContext context, HttpPipelineNextPolicy next)"
summary: "Processes provided request context and invokes the next policy."
parameters:
- name: "context"
type: ""
- name: "next"
type: ""
syntax: "public Mono process(HttpPipelineCallContext context, HttpPipelineNextPolicy next)"
desc: "Processes provided request context and invokes the next policy."
returns:
type: "Mono<>"
- uid: "com.azure.core.http.policy.CookiePolicy.processSync(com.azure.core.http.HttpPipelineCallContext,com.azure.core.http.HttpPipelineNextSyncPolicy)"
fullName: "com.azure.core.http.policy.CookiePolicy.processSync(HttpPipelineCallContext context, HttpPipelineNextSyncPolicy next)"
name: "processSync(HttpPipelineCallContext context, HttpPipelineNextSyncPolicy next)"
nameWithType: "CookiePolicy.processSync(HttpPipelineCallContext context, HttpPipelineNextSyncPolicy next)"
summary: "Processes provided request context and invokes the next policy synchronously."
parameters:
- name: "context"
type: ""
- name: "next"
type: ""
syntax: "public HttpResponse processSync(HttpPipelineCallContext context, HttpPipelineNextSyncPolicy next)"
desc: "Processes provided request context and invokes the next policy synchronously."
returns:
type: ""
type: "class"
desc: "The `CookiePolicy` class is an implementation of the interface. This policy is used to handle cookies in HTTP requests and responses.\n\nThis class stores cookies from the \"Set-Cookie\" header of the HTTP response and adds them to subsequent HTTP requests. This is useful for maintaining session information or other stateful information across multiple requests to the same server.\n\n**Code sample:**\n\nIn this example, a `CookiePolicy` is constructed. The policy can then be added to a pipeline. Any cookies set by the server in the response to a request by the pipeline will be stored by the `CookiePolicy` and added to subsequent requests to the same server.\n\n```java\nCookiePolicy cookiePolicy = new CookiePolicy();\n```"
implements:
- ""
metadata: {}
package: "com.azure.core.http.policy"
artifact: com.azure:azure-core:1.54.0