Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connections
Warning: mysqli::query(): Couldn't fetch mysqli in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\index.php on line 66
Article <6649af7f$0$10533$426a74cc@news.free.fr>
Deutsch   English   Français   Italiano  
<6649af7f$0$10533$426a74cc@news.free.fr>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!3.eu.feeder.erje.net!feeder.erje.net!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!212.27.60.64.MISMATCH!cleanfeed3-b.proxad.net!nnrp1-1.free.fr!not-for-mail
Newsgroups: fr.comp.lang.php
Subject: Re: Cookies
From: loiseauthierry@free.fr (Thierry Loiseau)
Date: Sun, 19 May 2024 09:51:25 +0200
References: <663b168e$0$16411$426a74cc@news.free.fr> <a6as3jl3an7ae0k499d2nutsfi6kiiujur@4ax.com> <663f6ff7$0$3288$426a74cc@news.free.fr> <v1o2lt$18kst$1@paganini.bofh.team>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Organization: La =?ISO-8859-1?Q?t=EAte_dans_les_=E9toiles?=
X-Face: "gCGw7%Nvy^)m::5L$E2$GtD~/}_(n-+"luS+tnv]{<Z]2,r?14o'gL9Xvrcw
        zvogC[>T6}`$N6clgfktLw2#uGy/{xsBg!I2z/uo/fKC'>_Pn6v`=Vz4^:BgbD+5XZjW
        mMh/,3"O`"P0/4kX1CDt3e&<Z(sd5vkNVbNiOEz}5;W3FNS+V@)bT<5S\nN,56_5/@3J
        gV#v2nMv5IanYb)C9*w&H@~79Eqyl(_vr
User-Agent: MacSOUP/F-2.8.4 (6da4d6e6d0) (Mac OS X version 10.9.5 (x86))
Lines: 58
Message-ID: <6649af7f$0$10533$426a74cc@news.free.fr>
NNTP-Posting-Date: 19 May 2024 09:51:28 CEST
NNTP-Posting-Host: 82.67.45.216
X-Trace: 1716105088 news-1.free.fr 10533 82.67.45.216:60964
X-Complaints-To: abuse@proxad.net
Bytes: 3047

Thomas Alexandre <none@no.invalid> wrote:

> C'est un problème de synchronisation. Quand vous créez/changez un cookie
> côté front, vous devez faire une requête au back pour qu'il soit au courant
> du changement.

Je n'ai pas une idée pour faire cela. Faire appel à une autre page
temporaire qui mettrait à jour le cookie via PHP via JavaScript ?

Actuellement, le code est :

============= 8-< ============
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Gestion cookie php et js
</title>
</head>
<body>
<!-- PHP  -->
<?php
//
// pas de point ni d'espace dans le nom du cookie
// (ils sont remplacés par des underscores...)
//
if (!isset($_COOKIE["test_php_js"])) $valeur="<vide>"; else
$valeur=utf8_encode($_COOKIE['test_php_js']);
echo "<h3>Récupération via php</h3>";
echo "<i>".$valeur."</i>";
echo "<hr>\n";
?>
<!-- /PHP -->
<script>
enrg=unescape( document.cookie.substring(
document.cookie.indexOf('test.php.js'))).substring(12)
valeur=prompt("votre texte",enrg);
duree=300000;
if (valeur===null) duree=-duree;
jour = new Date(Date.now() + duree);
expires=' expires='+jour.toGMTString();
document.cookie = 'test.php.js='+escape(valeur)+'; '+ expires;
if (valeur==enrg) document.write("<h3>Pas de changement</h3>"+valeur);
else
document.write("<h3>Nouvel enregistrement via JS</h3>"+valeur);
</script>
<hr>
<button onclick="window.location.reload()">Recommencer</button>
</body>
</html>
============= >-8 ============

?
-- 
       *    *                       __*__              *
    *           *      * -----oOOo--- O ---oOOo-------       *      *
                           http://astrophoto.free.fr     *
                 *    *  -------- oOOo oOOo ----------         *