Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8252861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:40:45+00:00 2026-06-08T00:40:45+00:00

This morning my local php starts behaving strangely: the session ID changes on each

  • 0

This morning my local php starts behaving strangely: the session ID changes on each request (making sessions unusable).

The code:

<?php
session_start();

The same page is available through “localhost” and “test” which is a /etc/hosts entry for localhost.

Requesting this same file on “localhost“: the PHPSESSID cookie stays the same; on “test” it changes on every request.

Absolutely nothing changed in my code (no BOM or buggy code) or in Apache’s config. I may have updated PHP (5.4.4), but reverting to the previous version (5.4.1) showed the same behavior. The same code running on a remote server (php 5.3) has been running ok for ages.

It’s probably a bug in PHP 🙁 but before reporting, I want to be sure I didn’t overlook anything.

Any idea?


Thanks for your amazingly fast answer.

In fact the browser works fine, everything is working fine, even PHP.

I just forgot I added a .htaccess clearing all cookies to upload to a CDN. The only thing I didn’t check was the .htaccess.

I feel stupid (and tired).

Thanks again.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T00:40:47+00:00Added an answer on June 8, 2026 at 12:40 am

    Install some software watching HTTP headers like

    • Live HTTP Headers Firefox addon https://addons.mozilla.org/en-us/firefox/addon/live-http-headers/
    • WireShark sniffer http://www.wireshark.org/

      and check whether

      1. Server sends the cookies as it should
      2. Browser sends them back.

    Probably the Cookie header contains settings which make Browser not to send it back, and therefore server generates a new cookie (new session) for every request.
    Especially check the path setting of the cookie you send.

    Also, it might be some new policy in browser, or a security plugin, or maybe antivirus… try different browser, or bare curl program, and disable web shield of your antivirus if applicable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This morning in my CS lab, I was compiling and executing some C code.
This morning we found an old chunk of code that was causing a library
Since this morning my local install of EE 1.6.8 is failing to load the
I deleted a Public Queue from my local box this morning and then went
This morning my PHP script, for Twitter OAuth posting, stopped working. I suspect that
Good Morning, I wrote the code block below on my local Windows 7 PC
This morning I moved a .NET website from our local server to live (not
This morning, I find myself writing something like: if (a == b == c):
This morning after Windows Updates ran and rebooted a pair of web servers, I
This morning I finally made my mind and decided to ask you for help.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.