I have been struggling for the past few days trying to get php session cookies working. They work on my own local network and they work fine on namecheap (which I am considering leaving) but I have been fighting to get session cookies working on dreamhost.
Today I wrote this very simple code that just increments by one each time the browser is refreshed. Works like a champ on my local apache2 server, dreamhost refuses to increment.
<!doctype html> <?php if (session_status() === PHP_SESSION_NONE) session_start(); if (! isset($_SESSION['X']) ) $_SESSION['X'] = 0; $_SESSION['X'] += 1; ?> <html> <body> <h2> X=<?php echo $_SESSION['X']; ?> </h2> </body> </html>
the test site is here:
What could I be doing wrong?