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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:17:16+00:00 2026-05-18T22:17:16+00:00

I am developing and doing all the testing on a local machine using PHP

  • 0

I am developing and doing all the testing on a local machine using PHP Version 5.3.3-1ubuntu9.1 version. The host machine is PHP Version 5.2.15.

All the seriliaze arguments are identical.

The problems is when i try to login the user on my test local machine I do the following:

$user->getByUserId($results['id'], $db); 
$_SESSION['user'] = serialize($user);

which retrieved and serialize the user and I just load it back whenever I detect that a session exists:

$user->LoadFromObject(unserialize($_SESSION['user']));

This works perfectly on my test machine. Just transfered the files on the host to see if I can get a beta version out but I keep on getting :

Warning: unserialize() expects
parameter 1 to be string, object given
in /home/gamerent/public_html/beta/includes/header.php
on line 19

i have noticed that if i echo the $_SESSION['user'] in both system the test will indeed display me the serialized one but the main one will just show me the object and will not serialize the $user.

UPDATE :

OK after some testing …..
i have seen that if i dump the session before initializing the user as

var_dump($_SESSION['user']);
$user = new User();
var_dump($_SESSION['user']);

it will display the session serialized correctly.
Exactly after that it will display the String of the sessions

My User doesnt do anything excpet init with default values

function User() {
        $this->userId = 0;
        $this->firstname = "Guest";
        $this->password = "";
        include_once('includes/generalUtils.php');
        $this->generalUtils = new generalUtils();
        include_once('includes/utils.php');
        $this->utils = new utils();
    }
  • 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-18T22:17:17+00:00Added an answer on May 18, 2026 at 10:17 pm

    You need to disable register_globals on the production machine. Otherwise you are registering a session variable by assigning to $_SESSION[‘user’]. Check these notes.

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

Sidebar

Related Questions

I have a client's Django project that I'm developing locally, using Mercurial for version
I'm a Perl programmer doing some web application testing using Selenium . I was
I am developing p2p application using RTFMP and flex.I am doing some research on
When developing a new web based application which version of html should you aim
So - management is looking to do a push to move towards doing unit-testing
I'm currently working on developing a windows service which will be deployed to all
I am currently developing a library and a set of programs using this library,
I'm developing a multilanguaged comics website and all the inserted comics must be in
I'm developing a dynamic website using jQuery and I have found several jQuery plugins
I am doing a tool in PHP for my personal use. But PHP is

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.