Advertisement
jamescolin

Page merci

Sep 19th, 2021 (edited)
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. <script>
  2. function setCookie(cname, cvalue, exdays) {
  3. var d = new Date();
  4. d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
  5. var expires = "expires="+d.toUTCString();
  6. document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
  7. }
  8.  
  9. function getCookie(cname) {
  10. var name = cname + "=";
  11. var ca = document.cookie.split(';');
  12. for(var i = 0; i < ca.length; i++) {
  13. var c = ca[i];
  14. while (c.charAt(0) == ' ') {
  15. c = c.substring(1);
  16. }
  17. if (c.indexOf(name) == 0) {
  18. return c.substring(name.length, c.length);
  19. }
  20. }
  21. return "";
  22. }
  23.  
  24. setCookie("boutiquemerci","OUI",365);
  25.  
  26. if (getCookie("boutiquedestination") != "") {
  27. window.location.replace(decodeURIComponent(getCookie("boutiquedestination")));
  28. }
  29.  
  30. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement