Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a website with many companies, want to include the companyno like this Account/Login/{CompanyNo}. So that on login browse, based on the company number, will change the logo on the login screen.

What I have tried:

Have modified the AccountController to handle this functionality. On successful login i am setting a session variable that is holding the company number. When user clicks on Log Out button, i will take value from session and redirect to Account/Login/{CompanyNo} again.

But when the application is running , if i modify and save web.config file, the site is redirecting back to Account/Login rather than Account/Login/{CompanyNo}. How to force the redirection at this point as i need? Looking for some suggestions on this
Posted
Updated 6-Apr-21 4:10am
v2

1 solution

By default, anything stored in the session will be lost when the application restarts. Editing the web.config file always causes the application to restart.

You will either need to store the company number somewhere else - eg: custom claims on the user, cookies, etc. - or change your redirect code to supply a default company number if the session variable is empty.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900