daily pastebin goal
40%
SHARE
TWEET

Untitled

a guest Apr 17th, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function setCookie(cname,cvalue,exdays)
  2.     {
  3.     var d = new Date();
  4.     d.setTime(d.getTime() + (exdays*24*60*60*1000));
  5.     var expires = "expires=" + d.toGMTString();
  6.     document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
  7. }
  8.  
  9. function getCookie(cname) {
  10.     var name = cname + "=";
  11.     var decodedCookie = decodeURIComponent(document.cookie);
  12.     var ca = decodedCookie.split(';');
  13.     for(var i = 0; i < ca.length; i++) {
  14.         var c = ca[i];
  15.         while (c.charAt(0) == ' ') {
  16.             c = c.substring(1);
  17.         }
  18.         if (c.indexOf(name) == 0) {
  19.             return c.substring(name.length, c.length);
  20.         }
  21.     }
  22.     return "";
  23. }
  24.  
  25. function checkCookie() {
  26.     var user=getCookie("username");
  27.     var cookieWarning = getElementByID("cookies");
  28.     if (user != "")
  29.     {      
  30.         cookieWarning = hidden;
  31.     }
  32.     else {
  33.     cookieWarning = visible;
  34.        }
  35.     }
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top