Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

Cookie - Read from cookie in JavaScript

<script language="JavaScript">

       var cookies = document.cookie;
       function readCookie(name) {
          var start = cookies.indexOf(name + "=");
          if (start == -1){
              return "Cookie not found";
          }
          start = cookies.indexOf("=", start) + 1;
          var end = cookies.indexOf(";", start);
          if (end == -1){
              end = cookies.length;
          }
          var value = unescape(cookies.substring(start, end));
          if(value == null){
            return "No cookie found";
          } else{
            return value;
          }
       }

       readCookie("ForgetCode");

    </script>