How can I pass session variable in symfony model without using sfContext::getInstance()
?
相关问题
- Chrome not keeping my _SESSION vars when coming fr
- Symfony form values missing
- Ratchet Session Data Synchronisation using memcach
- expire session when there is no activity in PHP
- Session getting destroyed on new page view
相关文章
- Cookie vs. Session based flash message
- Symfony 1.4 sessions randomly lost
- How to internationalize metas such as title in vie
- How to debug symfony in Netbeans? I cannot call sp
- Migrating Existing Users and Passwords to new Symf
- Copy a Doctrine object with all relations
- array_replace() / array_merge() | ( $_SESSION = ar
- mysql_real_escape_string() for $_SESSION variables
Session variables should be stored as user's attributes.
See how to get it back.
The recommended way is called dependency injection, and works like this: you create a
setUser()
method in your model file, that saves the given parameter to a private property:This looks clumsy, because it is. But without you answering the question what are you trying to do? I cannot give an alternative.
Recommended articles: