Project

General

Profile

Actions

Bug #79175

closed

AjaxWidgetContextHolder pollutes session data

Added by Dirk Wenzel over 7 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2017-01-05
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Summary
Ajax widgets do pollute the session data by storing their configuration on each page reload under a new identifier. Finally the session data grows too big to get loaded from the database.

Steps to reproduce
  • insert any Ajax widget into a page (e.g. f:widget.autocomplete)
  • reload the page a few times
  • watch the session data entry of the current user grow
    SELECT hash, tstamp, LENGTH(content) FROM fe_session_data;
    

(tested under current versions of 6.2 and 7.6)

Findings
Any Ajax enabled widget instance restores its widgets context via an instance of AjaxWidgetContextHolder.
This class stores the content of its $widgetContext property to either the FE or BE user session under the key TYPO3\\CMS\\Fluid\\Core\\Widget\\AjaxWidgetContextHolder_widgetContexts (see method storeWidgetContexts()).
In the constructor the content of this key is restored into the property $widgetContext.

On each call of the method store() a new unique ajaxWidgetId is generated and the configuration of the widget is added to the $widgetContext array.
This behaviour leads to a constantly growing size of the session data. It is only interrupted if the user session invalidates (by expiration or deleting the fe_user_session cookie).

Conclusion
I'm not sure about the expected behaviour.
There seems to be a conceptual fault though: Since the page content with the widget will most probably be cached, only the first entry of the $widgetContext array will be used as argument fluid-widget-id for the widget action link.

Any suggestions are welcome.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #92529: Remove fluid widgetsClosed2020-10-09

Actions
Actions

Also available in: Atom PDF