3

I have one server with php5.3 + nginx + php-fpm and second server with php5.3 + apache2. On both server in php.ini - session.serialize_handler = php. And on first server session is serializing like this:

onlineuser|a:2:{s:4:"user";O:8:"stdClass":81:{s:12:"category_ids";s:1:"2";s:2:"id";i:114756;s:5:"utype";i:2;s:6:"passwd";s:32:"...";.......}

And on second server session is serializing like this:

kP_xItrmVGDX_QFX-49QcYMf0nfnkEZrLSCLhypvPais0DkcFol7zblcQv_U2ET8X_ygrBglUuSGtH9T87nnE-5Nge3sFE0hdF6ZzO1Ba8mu12DAil5a18EPZAW3sb5tEELqaQK5ByGkomONxGUjmdSFkph4pMZR_2Dkg714SK7Wdh5ZZacdiZrGUXt4...............

It's look like serialization methods are different. Please advice how found out reason of this.

2 Answers 2

2

Seems like you have Suhosin PHP extension installed at 2nd server. If yes, set the parameter "suhosin.session.encrypt" to "Off" in it's php.ini

Sign up to request clarification or add additional context in comments.

Comments

1

I would check the PHP v5 Changelog, specifically I see:

  • v5.3.3
    • Fixed possible buffer overflows when handling error packets in mysqlnd. Reported by Stefan Esser. (Andrey)
  • v5.2.14
    • Fixed handling of session variable serialization on certain prefix characters. Reported by Stefan Esser (Ilia)

Gut instinct says it's the PHP engine, not the server it's hosted on, though it could also have to do with which binar(y/ies) and/or flags are loaded with the specific instance of PHP.

Are you working directly with the serialized data (which is why you're concerned with method)? I'm a little curious as to why if you are.

2 Comments

I am doing load balancing and save session in redis then i need one session for two servers. But serialization methods are different and data of session is lost. I have on first server php 5.3.3 and on second php 5.3.8
I understand that maybe on second server php started with flags and session serialization to binary. It's right?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.