Symfony2: How to save a session attribute as a custom field on DB, with a custom PdoSessionStorage?

后端 未结 2 465
孤独总比滥情好
孤独总比滥情好 2021-01-13 16:05

I have a custom class extending PdoSessionStorage, but I don\'t know how to catch attributes from the session to save them as independent fields in the database.

Oth

2条回答
  •  野的像风
    2021-01-13 16:32

    I've found it!

    My CustomPdoSessionStorage Class extends the NativeSessionStorage, which manages the $_SESSION array (read, write, etc...).

    So, from my class I can use $this->read('userId') and store it on my DB.

    So thanks a lot @hakre

提交回复
热议问题