react cookie

#include <iostream>
#include "reactcookie/reactcookie.h"

int main() {
    // Set a cookie with a name and value
    reactcookie::setCookie("username", "JohnDoe");

    // Get the value of a cookie by its name
    std::string username = reactcookie::getCookie("username");

    // Check if a cookie exists
    bool cookieExists = reactcookie::cookieExists("username");

    // Delete a cookie by its name
    reactcookie::deleteCookie("username");

    return 0;
}

Explanation:

  1. #include <iostream>: Includes the input/output stream library for handling input and output operations.
  2. "reactcookie/reactcookie.h": Includes the header file for using the React Cookie library in C++.
  3. reactcookie::setCookie("username", "JohnDoe");: Sets a cookie named "username" with the value "JohnDoe".
  4. std::string username = reactcookie::getCookie("username");: Retrieves the value of the cookie named "username" and stores it in the variable username.
  5. bool cookieExists = reactcookie::cookieExists("username");: Checks if a cookie named "username" exists and stores the result in the boolean variable cookieExists.
  6. reactcookie::deleteCookie("username");: Deletes the cookie named "username".
  7. return 0;: Ends the main() function and returns 0, indicating successful execution of the program.