Hello Friends, This post will explain you how you can create, read and delete the cookies in your webpage using Javascript. Here is the code to create cookies, In this below code, you can see, Cookies is Set to Name "RajeshCookie" and value is set to "Rajesh" and its expire time is set to next month as shown in below code.//for creating a cookie
<script type="text/javascript"> <!-- var today = new Date(); var nextMonth = new Date(today.getYear(), today.getMonth()+1, today.getDate()); setCookie("RajeshCookie", "Rajesh", nextMonth); // --> </script>
<script type="text/javascript"> <!-- var szName = getCookie("RajeshCookie"); // --> </script>
<script type="text/javascript"> <!-- deleteCookie('RajeshCookie'); // --> </script>
Disclaimer: This is a genuine effort by www.Induway.com, Induway Technologies is in no way responsible for the above mentioned information it is solely based upon the research work.
Your email address will not be published. Required fields are marked *
Name *
Email *
Website
Comment *