[[_cookieparam]]
== @CookieParam

[NOTE]
====
RESTEasy <<_newparam,supports `@CookieParam` annotations with no parameter name.>>. 
====

The `@CookieParam` annotation allows the injection of the value of a cookie or an object representation of an HTTP
request cookie into a method invocation.

----
GET /books?num=5
----


[source,java]
----

@GET
public String getBooks(@CookieParam("sessionid") int id) {
}

@GET
public String getBooks(@CookieParam("sessionid") jakarta.ws.rs.core.Cookie id) {
}
----

Like `PathParam`, the parameter type can be a String, primitive, or class that has a String constructor or static valueOf() method.
It can also get an object representation of the cookie via the `jakarta.ws.rs.core.Cookie` class. 


