Skip to content

[Cookies] Add implementation for cookies

Cookies

For cookies we can use attributes and mark them like @ReturnCookie

for example


@HttpReturnCode(200)
@ContentType("application/json")
@Serializable(CreamSerializers.JSON)
class MyViewWithCookies {
   @ReturnCookie('session') // Here we can rename the field 
   userSessionID: string;

   @ReturnCookie() // this will get the name 'customCookie' automatically
   customCookie: string;
}