|  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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 22 07:01:29 2024 UTC