Symfony session avoid _sf2_attributes

前端 未结 1 489
花落未央
花落未央 2021-01-23 18:02

Apparently every key I save to a Symfony2 session goes under a subkey:

$session->set(\'foo\', \'bar\');

Will result in:

arra         


        
相关标签:
1条回答
  • 2021-01-23 18:54

    This is not only the handler that you have to implement on your own, but it also should be your SessionStorage.

    By default, Symfony2 uses NativeSessionStorage. You should be looking for the method loadSession(). As you can see, it initializes a session with the $key received from getStorageKey(), which is initialized with _sf2_attributes here - in the AttributeBag

    Let me know if you have problems injecting custom session storage.

    0 讨论(0)
提交回复
热议问题