Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Cookie wird nicht gespeichert

Empfohlene Antworten

Veröffentlicht

Hallo zusammen,

ich will einen Cookie wie folgt speichern:


<?PHP
//Cookie setzen
foreach ($Anlage as $var)
{
$myArray[] = $var;
}
$cookstring = implode("@@@",$myArray);
SetCookie("cookstring",$cookstring,time()+60*60*24*30);
?>
[/PHP]

Lesen wie folgt:

[PHP]
<?PHP
//auf Cookie prüfen
if (isset($cookstring)==false)
{
$cookstring="0";
SetCookie("cookstring",$cookstring,Time()+60*60*24*30);
}
?>
<?PHP
//Cookie auswerten
function getArray($name)
{
return explode("@@@",$name);
}
?>
<?
//Cookie lesen
$datenarray = getArray($cookstring);
?>

Mein Problem ist dass der Cookie nicht gespeichert wird. Ich hoffe jemand

kann mir helfen.

Frank

wird er den überhaupt gesetzt?

Versuchs mal mit der vollständigen Syntax

setcookie("user",$id,time()+31536000,"/",".x3k6a2.net",0);

den letzten Wert als Security (ja/nein) muß man nicht setzen,

aber einige Browser könnten einen Cookie der ohne Doamin und Pfad daherkommt ablehnen wenn sie restrektiv eingstellt sind.

Wird das Cookie nicht gesetzt oder ist die Variable im Skript, das das Cookie ausliest nur leer?

Probier mal ueber $_COOKIE['cookstring'] auf den Wert zuzugreifen.

Hi,

Hast Du vielleicht eine "Internet Security" zum Beispiel die von McAfee oder Norton installiert? Hatte ich auch schonmal das Problem das meine Cookies immer gelöscht wurden.

Original geschrieben von palvoelgyi

Hallo,

bei uns in der Firma haben wir McAffee als Antiviren Software.

Also ist es in der Firma...ja?

Schau mal nach ob irgendwo der Haken bei Cookies automatisch löschen gesetzt ist. Weiß momentan leider nicht wo, aber ich denke das wird es sein. Was für eine Version des Scanners setzt ihr ein? Und läuft eine Firewall auf den Workstation oder auf dem Proxy?

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.