jamescolin

Page de capture

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