Answers for "set cookies in browser php"

PHP
1

setcookie php

setcookie($cookiename, $cookievalue, time() + (86400 * 30), "/"); // 86400 = 1 day
Posted by: Guest on August-18-2020
0

set cookie on button click php or js

function SetCookie(c_name,value,expiredays)
	{
		var exdate=new Date()
		exdate.setDate(exdate.getDate()+expiredays)
		document.cookie=c_name+ "=" +escape(value)+
		((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
	}
Posted by: Guest on May-02-2021

Browse Popular Code Answers by Language