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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:08:27+00:00 2026-05-30T00:08:27+00:00

In VS2010 I have two MVC 2 based web apps within the same solution

  • 0

In VS2010 I have two MVC 2 based web apps within the same solution that also share a common Setup project. One app is a configuration utility for setting up users and variables in the opposing app. Upon installation, the two IIS directories look like this on the user’s browser:
App1: http://localhost/App1/Auth/Login
App2: http://localhost/App1/App2/Auth/Login

The problem I’m having is when the user has both apps open at the same time, and logs out of one of them they are also logged out of the opposing app. This is a minor issue, but I’ve been tasked with correcting it.

From what I can tell, the two apps must be sharing the same Session object, because the logout command method in each controller invokes Session.Abandon() .

Only two controllers have the ability to log out a user; here’s the constructor’s from those controller’s:

App1: namespace App1.Controllers

/// <summary>
/// Functionality related to Assets
/// </summary>
public class AssetsController : Controller
{
private IConfig _config = null;
private IProfileRepository _profiles = null;
private IInspectionRepository _inspections = null;
private ICustomLabelsFactory _labels = null;
private IValidateRepository _validator = null;

/// <summary>
/// Create an instance of the AssetsController which uses the db.
/// </summary>
public AssetsController() : this(Config.Current, new ProfileRepository(Config.Current), new InspectionRepository(), new CustomLabelFactory(), new ValidateRepository()) { }

/// <summary>
/// Create an instance of the AssetsController with the given
/// IInspectionRepository implementation.
/// </summary>
/// <param name="inspections">IInspectionRepository implementation.</param>
public AssetsController(IConfig config, IProfileRepository profiles, IInspectionRepository inspections, ICustomLabelsFactory labels, IValidateRepository validator)
    : base()
{
    ViewData["_Module"] = "Assets";

    _config = config;

    _profiles = profiles;
    _profiles.ModelState = ModelState;

    _inspections = inspections;
    _inspections.ModelState = ModelState;

    _labels = labels;
    _labels.ModelState = ModelState;

    _validator = validator;
    _validator.CustomLabels = _labels.Assets;
    _validator.ModelState = ModelState;
}

App2: namespace App1.App2.Controllers

/// <summary>
/// Handles login/logout functionality
/// </summary>
public class AuthController : Controller
{
private ILoginService _login;
private IUtilityRepository _utility;

/// <summary>
/// Creates the Auth controller using the default User Repository which
/// uses the database.
/// </summary>
public AuthController() : this(new LoginService(), new UtilityRepository()) { }

/// <summary>
/// Creates the Auth controller with the given User Repository.
/// </summary>
/// <param name="userRepository">IUserRepository implementation.</param>
public AuthController(ILoginService loginService, IUtilityRepository utility)
    : base()
{
    ViewData["_Module"] = "Login";

    _login = loginService;
    _login.ModelState = ModelState;

    _utility = utility;
    _utility.ModelState = ModelState;
}

I might be barking up the wrong tree on where to start looking at the code, but I’m hoping someone can see something obvious here that I can’t. Or, maybe someone can tell me how to do this differently so there is not a shared Session object involved. I’ve been working on this on and off for the better part of this week, so any help offered will be greatly appreciated.

  • 1 1 Answer
  • 1 View
  • 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-05-30T00:08:29+00:00Added an answer on May 30, 2026 at 12:08 am

    You could configure each application to use a different session database in your web.config

    EDIT: something like

    <sessionState mode="SQLServer" sqlConnectionString="Data Source=.\SQLEXPRESS;User Id=test;Password=test;Application Name=AppName"  />
        <machineKey
    validationKey="SOMEKEY"
    validation="SHA1" decryption="AES"
    />
    

    Where somekey is different for each application

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

Sidebar

Related Questions

I have one solution in VS2010 containing two MVC 3 projects. These are two
I have a web solution (in VS2010) with two sub-projects: Domain which holds the
I have a VS2010 solution that has two projects. The first project [DevLib] is
I'm using MVC2 with VS2010 I have a view that has two partial views
I have a ASP.NET MVC2 project in VS2010 that can be deployed in two
I have a VS2008 Professional solution that I tried to convert to VS2010 Professional
I have a VS2010 solution with 5 projects. Two of these projects are called:
I have wrote an application that consists of two projects in a solution, each
I have just upgraded a solution with two web deployment projects from VS 2008
We have a VS2005 solution including two websites. We converted the solution to VS2010

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.