It is required to have some session variables set when customer visit store for first time, or his session was expired and renewed.
For existing customer it is possible to listen to
customer_customer_authenticated event and when customer logs in - and add variable to
core/sessionsingleton with observer, but how to deal with the guest user (or new registered customer ) ?
The main goal is to set some session variables when customer session is initiated, if the customer visits store for the first time, or its session was expired and reinitiated.
( From this session variables some layered filter defaults will be set, if the guest customer - one filter, if logged in - another filter - based on attributes of this customer, etc. But if session exists for him, let him to customize his layered filters in catalog area. )
How to accomplish this task ?