简体   繁体   中英

How can I turn off sessions in symfony 2/3?

我不需要在我的休息(无状态)api 中使用会话,如果我关闭它们,它会导致错误。

You may try using stateless in security.yml

security:
    firewalls:
        main:
            stateless:  true

Read Doc

Hope it's the thing you are looking for.

Make the firewall security to false:

security:
  providers:
    in_memory:
      memory: ~
  firewalls:
    main:
      stateless: true
      security: false

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM