eZ Community » Forums » Developer » Best way for session preferences
expandshrink

Best way for session preferences

Best way for session preferences

Tuesday 22 February 2011 11:56:51 am - 1 reply

Hi

I'd like to give for anonymus user an opportunity to store:
- numer of items per page (10, 20, 50...)
- sorting method

Ez preference stores data per user id. Each anonymus has the same id...

$view_parameters is not good, system will not remember user's decision. Session variable seems to be best, but how to store it easly, and deal with template cache?

Have you an idea, how to do this smoothly?

Tuesday 22 February 2011 1:27:28 pm

Hi,

Ez preference stores data per user id. Each anonymus has the same id...

In fact the preference system of eZ Publish is bit more clever because for anonymous users it uses session variables instead of storing values in the database. See https://github.com/ezsystems/ezpublish/blob/master/kernel/classes/ezpreferences.php

Cheers

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from