|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46547 PHP doesn't decode cookies anymore when POST body grows large
Submitted: 2008-11-11 16:19 UTC Modified: 2008-11-20 01:00 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: rix0rrr at gmail dot com Assigned:
Status: No Feedback Package: Session related
PHP Version: 5.2.6 OS: Debian Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: rix0rrr at gmail dot com
New email:
PHP Version: OS:


 [2008-11-11 16:19 UTC] rix0rrr at gmail dot com
When the body of a POST request grows too large, PHP stops decoding 
the passed-in cookies properly. Usually this results in a session 
that is dropped (the user being logged out, etc.)

Reproduce code:

  $FIELDS = 200;

  PHP Version: <b><?= phpversion() ?></b><br>
  Cookies: <b><?  print_r($_COOKIE);l ?></b><br>
  Session ID: <b><?= session_id() ?></b><br>

  <form method="post">
  <input type="submit" value="Send">
  <? for ($i = 0; $i < $FIELDS; $i++): ?>
      <input type="text" name="field[$i]" value="<?= md5(microtime()) ?>">
  <? endfor ?>

Expected result:
Session id does not change between posts, cookies are displayed.

Actual result:
Depending on the setting of $FIELDS, PHP does or does not drop the 
cookies and therefore the session.

On my setup, setting $FIELDS to 100 works fine and the session is 
maintained, setting $FIELDS to 200 exhibits the behaviour mentioned.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-11 18:44 UTC]
You left quite important things out of your report. Like what SAPI 
you're using for starters. And please, provide reproduce scripts 
without using the short tags. They're not enabled for everyone..
 [2008-11-12 09:17 UTC] rix0rrr at gmail dot com
This was on Apache/2.2.3 as a loaded module.
 [2008-11-12 13:09 UTC]
Please try using this CVS snapshot:
For Windows:

 [2008-11-20 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Feb 07 15:04:12 2023 UTC