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

  • SEARCH
  • Home
  • 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 8983241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:47:33+00:00 2026-06-15T20:47:33+00:00

I am experiencing a very weird behavior with PHP and session. The script that

  • 0

I am experiencing a very weird behavior with PHP and session.

The script that I am using has been working for months and it is working on various servers with various PHP versions.

the script read the URL and re-route depending on the URL, for example hitting /offer/abc1234.html it will call the class offer and pass abc1234 as parameter.

I have created a “failover” class that in other words if you write /abc1234.html it will test various database entries and if it finds one automatically include that class like if it was called by URL with just a bit of extra overhead, the difference is:

  • /offer/abc1234.html :: index.php -> offer.php -> home.php
  • abc1234.html :: index.php -> error.php -> failover.php -> offer.php -> home.php

Now, given that this all works and has been working for months my problem is with sessions.

if I hit /offer/abc1234.html I see the session set and the cookie sent to the browser

if I hit /abc1234.html the session is set correctly, no errors (E_STRICT+E_ALL), no warning, no nothing, but the cookie is not sent to the browser. I even tried to print the $_SESSION at the end of the script, and the session is populated and all the vars are correct except the headers.

I have tried to debug it and add various var_dump in various places, but nothing is different anywhere except the header_list() never contains the session_cookie but it does contain other cookies that I manually set:

I currently print:

  • session_name()
  • session_id() – this changes at each refresh but it is consistent on the whole page
  • session_get_cookie_params()
  • headers_list() – this does not contains the set-cookie header that session_start should have

the output is something like:

  • string(6) “QSCSID”
  • string(26) “456disv3pl4u2j81dej6h6d717”
  • array(5) { [“lifetime”]=> int(0) [“path”]=> string(1) “/” [“domain”]=> string(0) “” [“secure”]=> bool(false) [“httponly”]=> bool(false) }
  • array(4) { [0]=> string(38) “Expires: Thu, 19 Nov 1981 08:52:00 GMT” [1]=> string(77) “Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0” [2]=> string(16) “Pragma: no-cache” [3]=> string(68) “Set-Cookie: spi=17468; expires=Sat, 26-Oct-2013 05:02:23 GMT; path=/” }

Again, I am getting crazy as everything was working earlier in the day, then I restarted apache and it stopped working.

I have checked the server, and the folder is not full and it is writable and the files get created and are empty when I call abcd1234.html

EDIT
while working on it, I start to open the files via “ee” (FreeBSD editor) directly on the server. Nothing happened until I opened/saved a class, no changes were made on the file, I accidentally added a space and removed it, then when I exited the editor asked me to save and I said YES.

PHP is compiled with eaccelerator, I had already removed the cache folder as well as re-restarted apache and saw the folder autopopulate. Such class (the failover.php) is a simple 4 function where each function is a query, then the construct call each function one at the time.

So, it seems working, but I would like to know if anyone ever experienced something like this and if they knew what the issue might have been

  • 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-15T20:47:35+00:00Added an answer on June 15, 2026 at 8:47 pm

    I haven’t been able to replicate it, once I opened the file and closed with “ee” on FreeBSD everything worked .

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

Sidebar

Related Questions

I am experiencing some weird behavior with an android app I have been working
I'm currently experiencing very unusual behavior when using the each method of a Backbone
This is some weird behavior... Whenever I script certain tables (using CREATE TO...) or
I'm experiencing a very curious problem. I have a list named theorems that has
I am experiencing some very strange behavior with Blend: Since weeks i am working
I am experiencing very difficult (hard to find) problem with my PHP login script.
While working with pointers in C, I have been experiencing a very incosistent result,
I am experiencing a very weird problem: In WPF I have a tabControl which
I am using JDK 1.6.0.18 for my Swing application. I am experiencing very different
I am experiencing some very odd timing behavior from a function I wrote. If

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.