Absolutely, it is possible to set cookies, but keep in mind that this may not be effective on a new computer and the data could potentially be lost if the browser data is cleared. What is the specific reason for wanting to utilize cookies for this purpose?
set cookie:
document.cookie = "username=John Doe";
check if it exists:
function checkCookie() {
var username = getCookie("username");
if (username != "") {
alert("Welcome back " + username);
} else {
username = prompt("Please input your name:", "");
if (username != "" && username != null) {
setCookie("username", username, 365);
}
}
}
php set cookie:
setcookie("name","value",time()+$int);
check if it exists :
if(isset($_COOKIE[$cookie_name]) {}