Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-474

Extra output Sent by during Script execution which leads to Cookie headers not being send

    XMLWordPrintable

    Details

    • Type: Bug Report
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.2
    • Fix Version/s: 5.1.2-B2
    • Component/s: Front End
    • Labels:
      None
    • Additional information:
      Hide

      Related issue is with "Remember Me" checkbox being used. Initially we don't create session on front-end, when it's no needed. When user logges in with "Remember Me" checkbox checked, then later, when user session will expire, then it will be recreated using "remeber_login" cookie set first time.

      Because of session is created after output is made (see kApplication::Done method), then SID will never be placed in cookie. Only works, when debug mode is on.

      Ideas how to fix that:

      I don't see any reason, why session is saved before page output is sent to browser, because session saving doesn't take too much time anyway (especially, when no session data was changed). Agents are run just before session data is saved there and that's wrong, because agent is session-independent event in all cases and we should save session before that.

      Need to check all agents, to confirm that.

      Show
      Related issue is with "Remember Me" checkbox being used. Initially we don't create session on front-end, when it's no needed. When user logges in with "Remember Me" checkbox checked, then later, when user session will expire, then it will be recreated using "remeber_login" cookie set first time. Because of session is created after output is made (see kApplication::Done method), then SID will never be placed in cookie. Only works, when debug mode is on. Ideas how to fix that: I don't see any reason, why session is saved before page output is sent to browser, because session saving doesn't take too much time anyway (especially, when no session data was changed). Agents are run just before session data is saved there and that's wrong, because agent is session-independent event in all cases and we should save session before that. Need to check all agents, to confirm that.
    • External issue ID:
      604
    • Copy Issue Key:
    • Patch Instructions:

      Patches must be submitted through Phabricator.

      Description

      Starting In-Portal 5.0.1 (possibly even 5.0) we have came across the
      situation when Cookie hasn't been set due to issue with script sending
      extra output (wasn't buffered by PHP) during it's runtime. This lead
      to the issue with properly setting the Cookie when required. In
      particular this happens on the Front end when you are trying to add a
      product to your cart and new session is created, but can affect other
      places as well.

      The above issue is ONLY in affect when PHP configuration setting
      "output_buffering" has NO value. By default it's set to 4096 (4K), but
      sometime changed to No Value.

      Here is a link to PHP manual with more description on Output Control
      system in PHP http://www.php.net/manual/en/intro.outcontrol.php

      While it was done before - the task is:

      1. check and find all places where extra (early) output is sent.
      2. Do check before installation on "output_buffering" setting which is
      preferable to have some value.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                alex Alex
                Developer:
                Alex
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: