[ZBX-11610] CSession class handles PHP sessions the wrong way Created: 2016 Dec 15  Updated: 2017 Oct 19  Resolved: 2017 Oct 19

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 3.4.0alpha1
Fix Version/s: None

Type: Problem report Priority: Trivial
Reporter: Vjaceslavs Bogdanovs Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: cookie
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File sessions.png    
Issue Links:
Sub-task
depends on ZBX-12543 Problem with login in Internet Explorer Closed

 Description   

The way CSession class handles PHP sessions is invalid. Any call for setValue, getValue, etc. starts with the call to session_start (that should be done once for the whole execution) causes PHP to set additional cookie with the same value.

The simplified test-case is:
for($i = 0; $i < 1000; $i++)

{ CSession::getValue('test'); }

Result is:



 Comments   
Comment by Oleksii Zagorskyi [ 2016 Dec 15 ]

I saw such behavior in zabbix code when I had to work on a custom patch and was also surprised to see session start and later functions which automatically start session.

Also - ZBX-9383 might be related.

Comment by Vjaceslavs Bogdanovs [ 2017 Oct 19 ]

Resolved as a part of ZBX-12543

Generated at Thu Apr 24 02:34:21 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.