How to store a value in a cookie and to get that value.

Here is code to create a variable in cookie and we are set a value to that and then getting in the same code.

//We need to add dependency :
'js.cookie' in the code

//Then for setting the value to cookie 

Code:
Cookie.set("detailsApprove", requiredPortion,{ expires: 365 });

For getting value from the same variable:
var approveDetails = Cookie.get("detailsApprove");

Leave a comment

Your email address will not be published. Required fields are marked *