i am trying to set cookie in electron-react app using npm react-cookie package
and setting cookie like that
import { useCookies } from "react-cookie";
const [cookies, setCookie, removeCookie] = useCookies();
setCookie("isWorking", 121, { path: "/" });
its work fine in development mode but as i build electron application its not set my cookies in build application
SnapShot of cookies in development
You can do:
import { useCookies } from 'react-cookie'
// Declare the useCookies hook
const [cookies, setCookie, removeCookie] = useCookies(['name'])
// Set a cookie
setCookie('name', 'value', { path: '/' })
// Retrieve the cookie from `cookies` object
const name = cookies.name
// Remove the cookie
removeCookie('name')
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.