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 8950957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:33:24+00:00 2026-06-15T13:33:24+00:00

I have these tables in the database : user: – email – lastname –

  • 0

I have these tables in the database :

user:
- email
- lastname
- firstname
- password

userType1:
- fkUser
- specialCol1
- specialCol2

userType2:
- fkUser
- specialCol1
- specialCol2

I’ve made the Symfony2 authentification service working with user table but i want to store in the session (or in other place manage by the authentication) the associated object: userType1 or userType2.

Futhermore, i want to redirect the user to its account depending on his type.

So my questions :

How to make treatement after submitting authentification form ? (to determine which type of user it is)

How to tell to Symfony to manage an other object (the user type) in the authentification context ?

  • 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-15T13:33:25+00:00Added an answer on June 15, 2026 at 1:33 pm

    Have a look at the cookbook-entry How to load Security Users from the Database. The sections “Authenticating Someone with a Custom Entity Provider” and “Managing Roles in the Database” might be helpful.

    I had a similar problem with an authentication-procedure where a User and their Tenant-memberships were required. I built a custom provider which basically looks like the one from the cookbook. When serializing the User I only use certain field (id, username, email) and the rest of the data is fetched via the provider’s refreshUser(), where again the User and their relationships are fetched via QueryBuilder. I had the problem, that when serializing the User in the session, the relationships were “lost” otherwise and I had to refetch the User all the time.

    After that it’s basically what @BenjaminPaap wrote. You retrieve the user as described in the documentation and get the user types, etc.

    If you want to redirect the user to a certain target depending on their userType, you might want to look at “How to create a custom UserProvider“. The Listener provides everything you need to redirect the user according to their type right after login.

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

Sidebar

Related Questions

I have a few tables in my database User (userid, password roleid) Role (
I have an access database with these tables: - sequences: it describes the sequences
I have the following tables, with these keys in my database: bookings session_id sessions
In my Rails application, I have a variety of database tables that contain user
I have a database with 3 tables. These tables represent membership information. I only
I'm building a database where I have these 2 tables: 1) [users] with the
I have 3 tables in mySQL database. questions_table with these fields: question_id (unique ID
I have three tables in my SQL 2008 database: User, CutomerUser and SalesUser. They
I have these tables in my database: 'products' belongs to a 'company', and 'company'
I have these two database tables: locations id name users id location_id last_name first_name

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.