Skip to content

Tag: cookies

Cookie set without a name

I’m trying to set a simple cookie but the name of the cookie is never set. I’m setting the cookie like this: The name of the cookie is not set, only content is set with the name + the value. The environment variable is defined properly since it’s displayed in the “content”. Why i…

How to delete a cookie in Reactjs

I am developing a web app with react front-end and node baack-end I want to delete the cookie being stored so that I can successfully be able to logout the user. I have tried using the js-cookie library and react-cookie library but it does not work. nav_component: How I set the cookie in the backend: It shoul…

Set cookie everytime user deletes it

I want to create a cookie everytime a user deletes it, using Javascript. For example, I have many cookies, even some cookies which set a ban time to the user who abuses the website. Basically I want to set a cookie which will be set whenever all of the cookies are deleted. Btw, I do not want to create the

HttpOnly cookie is set only after the second request

I have a server (Node.js + Nest.js) and a client (Angular 11). The client submits a login request and the server logs in the user and sets a HttpOnly cookie in the response. The wierd thing is that the cookie is set in the browser only after submitting 2 requests, then it works fine (If i use postman for exam…

Enabling 4-digit pincode autofill using cookies

I have a simple form where one needs to enter a 4-digit PIN code. However, I would also like to autofill that PIN code when the user comes back to the website again, using JS cookies. JS: HTML: I’m aware of a few things that are wrong about this code. in the checkCookie() function, if the user has a coo…