Project

General

Profile

Actions

Bug #54445

closed

Session data can't be fetched for non authenticated fe_users

Added by Marcin Sągol over 10 years ago. Updated over 10 years ago.

Status:
Rejected
Priority:
Must have
Assignee:
-
Category:
Frontend
Target version:
Start date:
2013-12-16
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.4
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hi again,
as i need to store some data in session (basket items) for users visiting website i have created a little service to handle session action. All seems to work just fine for authenticated fe_user. The problems start with guests that are not authenticated.

Their data lands in 'fe_session_data' table identified by unique hash and this hash is a problem here. On each page reload its different - the $id (that is hash in fe_session_data table) changes in TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication - so the saved data is never fetched.

On line 406 we have:
// If new session or client tries to fix session...
if (!$id || !$this->isExistingSessionRecord($id)) {
// New random session-$id is made
$id = $this->createSessionId();
// New session
$this->newSessionID = TRUE;
}

and the $this->isExistingSessionRecord($id) always returns false for not authenticated user as it checks for session in 'fe_sessions' table where records are created only for authenticated users (method createUserSession() is calle donly for authenticated user)!

So all this results with this:
if we set some data to be stored in 'fe_session_data' (not authentictated user) it is put there on each reload as it cant find it because hash ($id) changes each time!

I hope this can be fixed and i did not missed something to make session works for not authentictated users.

Actions

Also available in: Atom PDF