Asked by Wilson Edwards
at 2025-02-11 17:07:11
Point:500 Replies:1 POST_ID:829291USER_ID:12108
Topic:
javscript;google_cookie
For latest browser, u can only read cookie value by javascript code. Remove and Update cookie by javascript is very difficult...
To read all cookie, u can go to devtool, Mouse Right-click->inspect->Application->Cookie
u can see all website cookie u are accessing..
You can remove all cookie for the website..by php coding
For example:
<?php
if(isset($_SERVER['HTTP_COOKIE'])&&stripos("#".$_SERVER['QUERY_STRING'],'gt=3')>0)
{
$cookies = explode(';', $_SERVER['HTTP_COOKIE']);
foreach($cookies as $cookie) {
$parts = explode('=', $cookie);
$name = trim($parts[0]);
setcookie($name, '', time()-1000,'computer28.com');
setcookie($name, '', time()-1000, '/','computer28.com');
setcookie($name, '', time()-1000,'.computer28.com');
setcookie($name, '', time()-1000, '/','.computer28.com');
}
}
if(stripos("#".$_SERVER['QUERY_STRING'],'gt=3')>0)
{
header("location:https://computer28.com");
}
?>
On address bar with gt=3, it will forward to the main domain site,
For update cookie,
justsetcookie($name, ''', "the time you want for expire",'computer28.com');
Hope it help