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

  • SEARCH
  • Home
  • 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 8364677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:28:47+00:00 2026-06-09T12:28:47+00:00

Symfony2 provides a very simple tool for user login. In practice, the framework do

  • 0

Symfony2 provides a very simple tool for user login. In practice, the framework do all the security controls for you. As shown in the official doc, a controller (SecurityController) can be used to load the login form page. Then, a route is associated to login check the input provided by the user through the login form. If the login is correct, the user is redirected to the home page (or another one); otherwise, the user must re-enter username and password.

Since I need to load in the session some user preference from a database, I want to know if there is a way to execute such a function once the login check ascertained the correctness of the user login.
Any idea?

  • 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-09T12:28:48+00:00Added an answer on June 9, 2026 at 12:28 pm

    You have to write your own AuthenticationHandler which will implement two interfaces below:

    class AuthenticationHandler implements AuthenticationSuccessHandlerInterface
    

    In that handler you should define method onAuthenticationSuccess()

    Inside this method you can do whatever you need.

    Don’t forget also to set your listener in security.yml

    firewalls:
        main:
            ....
            your_form_login:
                ...
                success_handler: your.authentication_handler
    

    Check also this useful doc

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

Sidebar

Related Questions

Symfony2 and FOS User Bundle issue... I have implemented my own login form in
I am working on a relatively simple login system for Symfony2. I have the
I have a very basic Symfony2.1 setup with FOSUserBundle installed. When registering all is
In symfony2 project php bin/vendors install , re-installs all bundles in deps file. Each
I'm currently using Symfony2 framework. I don't know how to join 2 of my
I am testing Security environnement within Symfony2 and hav problem with log out process
I'm trying to authenticate a user on my symfony2 server. The authentication works with
I have a question to the security features of Symfony2. I want to protect
I'm using Symfony2 to authenticate users. And I have two databases to store user
Since this article http://symfony.com/doc/2.0/cookbook/security/custom_provider.html has not been written yet, has anyone an idea of

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.