Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8620383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:34:02+00:00 2026-06-12T06:34:02+00:00

I have a Symfony2 app representing a restful application that has no need for

  • 0

I have a Symfony2 app representing a restful application that has no need for persistent sessions.

For each request to the application, given the default session configuration, and given that the client ignores the session cookie, a new session file is created in the default session save path of app/cache/<env>/sessions.

The app receives many requests per day resulting in a very large volume of unwanted session files. Running rm -Rf app/cache/prod/session/* takes minutes to complete.

I would prefer if the app did not store any session data.

I have tried setting the application configuration session save path to /dev/null or /dev/null/sessions but this results an exception either due to the directory already existing (for /dev/null) or due to the specified path being not a directory (for /dev/null/<anything>).

framework:
    session:
        save_path: /dev/null

The best I can see I can do from reading the session documentation is to invalidate the session, which clears all session attributes and regenerates the session ID. This doesn’t get me to a state of there being no session and no persistent session file.

Can I get Symfony2 to not store any session data for a request?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T06:34:03+00:00Added an answer on June 12, 2026 at 6:34 am

    You can define your own Session handler and replace session service alias with it:

    services:
        session:
            class: Path\To\Your\Session\Class
    

    You can check implementation with standard session class Symfony\Component\HttpFoundation\Session\Session

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Symfony app that populates the widgets of a portal application and
I have a console app, (written as a Symfony2 command) that is reading input
I have a Symfony2 command line app that I've built. It fetches a ton
I have a Symfony2 application, with a bundle that have a couple of entities
I have a Symfony2 project with a MySQL db: #app/config/config.yml doctrine: dbal: driver: %database_driver%
I have a Symfony 1.4 app using sfDoctrineGuardPlugin for users. I need to move
In Symfony2 (2.0.3) I have a BetaBundle that is set as the parent of
I have an issue in that a Symfony2 form can pass validation but still
We have bundles for Facebook & Twitter authorization for a Symfony2 app. But what
I have a symfony app that uses the json_encode and json_decode to keep a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.