Hey, is it possible to use more of your stuff, like this password strength and email validation etc. on one screen at the same time on the site? If so, how?
Cookies are small pieces of text sent to your browser by a website you visit. They help that website remember information about your visit, which can both make it easier to visit the site again and make the site more useful to you. The cookie box I have made is set only one cookie value which name is codinglab, and until that cookie expired model box will not come if you click on accept button. That cookie is for only that model box.
A good example of cookies is when you tick a box on a login page that says to remember your login for something like 30 days. Sets a cookie for 30 days and saves you having to log into that website every time. If you don't accept cookies on that website, then the remember me function won't work.
Very good! Thank a lot ! It works fine except how can I make the cookies window disappear when the person clicks decline? I would just like the box not to recharge when the user refuses. Please tell me if you have a solution?
Hello and thanks for the tutorial but the pop up keeps showing after i refresh the page when i click on decline... do you have a solution ? Thank you :)
I just needed the JavaScript part with the cookie and it works perfectly. Thank you so much for this video. Very helpful : )
Easy to follow and worked like a charm! Thank you!
thank you!!!! how can I make the cookie window disappear when the person clicks reject?
perfect :)
Hey, is it possible to use more of your stuff, like this password strength and email validation etc. on one screen at the same time on the site? If so, how?
Can you explain for what cookies are used for? If a user accepts it, what will be next, like we would know the user's information?
Cookies are small pieces of text sent to your browser by a website you visit. They help that website remember information about your visit, which can both make it easier to visit the site again and make the site more useful to you. The cookie box I have made is set only one cookie value which name is codinglab, and until that cookie expired model box will not come if you click on accept button. That cookie is for only that model box.
A good example of cookies is when you tick a box on a login page that says to remember your login for something like 30 days. Sets a cookie for 30 days and saves you having to log into that website every time. If you don't accept cookies on that website, then the remember me function won't work.
Very good! Thank a lot ! It works fine except how can I make the cookies window disappear when the person clicks decline? I would just like the box not to recharge when the user refuses. Please tell me if you have a solution?
const cookieBox = document.querySelector(".wrapper");
const buttons = document.querySelectorAll(".button");
// Function to check if a cookie exists
function getCookie(name) {
const nameEQ = name + "=";
const cookies = document.cookie.split(';');
for (let i = 0; i < cookies.length; i++) {
let cookie = cookies[i];
while (cookie.charAt(0) === ' ') {
cookie = cookie.substring(1, cookie.length);
}
if (cookie.indexOf(nameEQ) === 0) {
return cookie.substring(nameEQ.length, cookie.length);
}
}
return null;
}
const executeCodes = () => {
// Check if either cookieBy or cookieDeclined exists
if (getCookie('cookieBy') || getCookie('cookieDeclined')) {
return; // Do nothing if either cookie exists
}
cookieBox.classList.add("show");
buttons.forEach((button) => {
button.addEventListener("click", () => {
cookieBox.classList.remove("show");
if (button.id === "acceptBtn") {
// Set cookie for acceptance
document.cookie = "cookieBy=codinglab; max-age=" + (60 * 60 * 24 * 30);
} else if (button.id === "declineBtn") {
// Set cookie for decline
document.cookie = "cookieDeclined=true; max-age=" + (60 * 60 * 24 * 30);
}
});
});
};
// Execute function on page load
window.addEventListener("load", executeCodes);
Hello and thanks for the tutorial but the pop up keeps showing after i refresh the page when i click on decline... do you have a solution ? Thank you :)
Hello, what IDE are you using here?
Vs code editor
very good and useful ´work!
Js no working
Hello guys, should i use it on every page of the website? or just write it on 1 page?
You should put it on your index or home page! So use it only once :)
what is the use of cookies?
You don't need to signin again in a website
JS doesnt work
source code?
Link is in the description.
please give html css full website design tutorial
Here they are - ruclips.net/video/Xuso8gekEdg/видео.html
ruclips.net/video/gUxIzo3gj-g/видео.html
@CodingLab Hi men! Please create a video on how to create a login system using cookie 🍪! In js. Pin me!
Okey I will think about it.