cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Session attribute on search restriction in backoffice

former_member677853
Discoverer
0 Likes
1,475

Hi,

I need to add a custom attribute to the session for search restriction purpose (in backoffice). The issue is that when I add such attribute to the session using sessionService on filter level added to backofficeFilterChain this attribute is set correctly but is not visible during search restriction evaluation.

Backoffice sais that session.attribute is not visible/present.

When I debug in the code it appears that sessionService used in FlexibleSearch execution is different then sessionService on filter level (bean is the same but attributes are different). Attributes for restriction evaluation are always the same (user, catalogVersion, etc.)

I don't know why? Any ideas? Something is clearing session before search execution? The session is not the same because it's different between web context (filter) and core context (FlexibleSearch)? How can I add some custom attributes visible on SearchRestriction evaluation in backoffice? On storefront level, such session attribute is visible without any problem.

Thanks
Łukasz

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member625836
Active Contributor
0 Likes

Hi ,

I guess that you are referring to de.hybris.platform.servicelayer.session.SessionService. Did you try using com.hybris.cockpitng.util.CockpitSessionService?

I don't know your case in details, but maybe you could use org.springframework.security.web.context.HttpRequestResponseHolder and put something to HttpSession directly?

Cheers, Jacek