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 6692873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:55:03+00:00 2026-05-26T05:55:03+00:00

I have a PHP Session variable set: $_SESSION[‘token’]=$_POST[‘token’]; on newOrder.php . Also set is

  • 0

I have a PHP Session variable set:

$_SESSION['token']=$_POST['token']; on newOrder.php.

Also set is $_SESSION['orderId'], $_SESSION['stylesUrl'], $_SESSION['brand'] and $_SESSION['currentBalance']

There is a link on newOrder.php to templateSelection.php (same server).

At the bottom of newOrder.php I do a print_r($_SESSION) with the following output:

[token] => {61424637-6E77-BCE0-A10B-3F3E9F74753E}
[currentBalance] => 991.0000
[stylesUrl] => /Management/Stylesheets/basic.css
[brand] => YM
[savedOrderReturnURL] => /Management/DirectMail/DirectMailSaveOrder.aspx

This is directly at the bottom of the newOrder.php page with just two lines of HTML afterwards. When a user clicks a link to templateSelection.php the following php is processed:

<?php include("php/db.php");
header('P3P: CP="NOI ADM DEV COM NAV OUR STP"');
//$_SESSION['username']="bymtest";
//We seem to be getting an orderId in the session variable even though there wasn't one just before this page was called.
$debugMode = true;
if($debugMode) {
    echo "<pre>";
    print_r($_SESSION);
    echo "</pre>";
    die();
}

Inside php/db.php is:

$dbhost = 'host';
$dbuser = 'un';
$dbpass = 'pw';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
$db = mysql_select_db("db");
session_start();

Now this is the weird part. In firefox and chrome, the print_r in templateSelection.php outputs:

[token] => 
[currentBalance] => 991.0000
[stylesUrl] => /Stylesheets/basic.css
[brand] => YM
[savedOrderReturnURL] => /Management/DirectMail/DirectMailSaveOrder.aspx

However in Opera and IE9/8/7/6 it outputs

[token] => {61424637-6E77-BCE0-A10B-3F3E9F74753E}
[currentBalance] => 991.0000
[stylesUrl] => /Management/Stylesheets/basic.css
[brand] => YM
[savedOrderReturnURL] => /Management/DirectMail/DirectMailSaveOrder.aspx

session_start is always set, I have tried on multiple computers… it just makes no sense! This has also worked before on a different URL, on the same server.

  • 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-05-26T05:55:04+00:00Added an answer on May 26, 2026 at 5:55 am

    As @Griwes suggests, you need to call session_start() at the top of your script.

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

Sidebar

Related Questions

I have a session variable that I set like this: <?php $token = md5(uniqid(rand(),
I have one PHP script with a session variable, set like so: $_SESSION['VAR1'] =
I have a PHP application where I set $_SESSION['user']=logged once a user is authenticated.
I need to set a PHP $_SESSION variable using the jQuery. IF the user
I have the following problem... I want to set a session variable when clicking
I have a very simple test page for PHP session. <?php session_start(); if (isset($_SESSIONS['views']))
I am trying to use PHP session without using cookies. I have enabled session.use_trans_sid
I currently have a custom session handler class which simply builds on php's session
I have two PHP scripts, both using the same session by calling session_name('MySessID') .
I have problem with session in cakephp.I have one file chat.php that is in

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.