Make your session namespacedSymfony 2, Tip and tricks

by Andrea Giuliano on 9 ottobre 2013 with 0 comments

Separating the scope of variables in session is a good practice for organizing attributes. Symfony comes with the Session component, a powerful way to manage the session. Imagine you want to store some attributes of some volatile structure in your application. You can store them in this way: $session->set(’promo_code’, ‘MY_PROMO_CODE’); $session->set(’promo_name’, ‘MY_PROMO_NAME’); That’s all right. …

leggi ...