Jump to content
View in the app

A better way to browse. Learn more.

The Uniform Server Community

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.

Ques: Why dont my cookies work?

Featured Replies

Hi All,

I am having some major problems using cookies. Whilst developing the site on localhost I had no problems.

I have configured my firewall to forward http traffic from a public IP to my machine and cookies just will not work.

I have created a simple test page which consist of this:

<?php

$value = 'something from somewhere';

setcookie("TestCookie", $value, time() + 3600);


// Print an individual cookie
echo $_COOKIE["TestCookie"] . "<br>";
echo $HTTP_COOKIE_VARS["TestCookie"] . "<br>";

// Another way to debug/test is to view all cookies
echo "<pre>"; print_r($_COOKIE); echo "</pre>";
?> 

But no cookie is created.

Can anybody tell me why? Is it related to my firewall?

  • Author

Nah its not that. It's doing this in Firefox as well.

I have been monitoring the HTTP headers sent to/from the server and I can see the request to create a cookie and the client is sending it back in the header.

I have just noticed however that there is something funny in $_SERVER.

When accessed through localhost it looks like this

 ["HTTP_COOKIE"]=>
 string(15) "test=test+value"

When accessed from the Internet i get this

 ["HTTP_XOOKIE"]=>
 string(15) "test=test+value"

 

What is XOOKIE and why is the data sent there?

  • Author

I have solved the problem.

Our firewall uses something called Protection Profiles (its a FortiGate) that was deforming the cookie part of the packet.

I removed the option to block cookies and everything is A-OK. :P

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

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.