Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

rest

php

symfony

I don't need to use sessions in my rest(stateless) api and if I turn off them, it's causing an error.

like image 835
user3058157 Avatar asked Nov 15 '16 09:11

user3058157


People also ask

Where does Symfony store sessions?

However, if you have the following configuration, Symfony will store the session data in files in the cache directory %kernel. cache_dir%/sessions . This means that when you clear the cache, any current sessions will also be deleted: YAML.

What is session in Symfony?

Symfony provides a session object and several utilities that you can use to store information about the user between requests.


1 Answers

You may try using stateless in security.yml

security:
    firewalls:
        main:
            stateless:  true

Read Doc

Hope it's what you are looking for.

like image 107
Gopal Joshi Avatar answered Oct 15 '22 01:10

Gopal Joshi