chevron_right
chevron_right
chevron_right
chevron_right
chevron_right
chevron_right
chevron_right
chevron_right
chevron_right
chevron_right
chevron_right
chevron_right

cookie is class member of Wall, Guard , Shield and Controller.

Let's see how we can use cookie -

import { Controller, DefaultWorker textResult, viewResult } from "fortjs";
import { HttpCookie } from "fortjs";

export class DefaultController extends Controller {
    @DefaultWorker()
    async default() {

        // check exist
        const isCookieExist = this.cookie.isExist('cookie_name');

        // get cookie
        const cookie = this.cookie.getCookie('cookie_name');

        //add cookie
        const newCookie = new HttpCookie('new_cookie','cookie_value');
        this.cookie.addCookie(newCookie);

        //remove cookie
        this.cookie.removeCookie('cookie_name');

        return textResult("Hey, we have tested cookie successfully");
    }
}

In the same way you can access cookie in Wall, Guard and Shield.