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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:10:31+00:00 2026-05-16T07:10:31+00:00

We have got two distinct lists of users that we need to power logged

  • 0

We have got two distinct lists of users that we need to power logged in access to sections of our site.
These lists can’t be combined, as one is synced daily to an externally hosted data source, and both tables have to be 100% the same.

We have set up two Membership providers onto the site, but my question is, is it possible to allow both to be logged in at the same time?

The issue I find is that HttpContext.Current.User.identity.name contains the username of the last successful logon.

  • 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-05-16T07:10:31+00:00Added an answer on May 16, 2026 at 7:10 am

    Use some sort of delimiter and put both users into the the login Identity. e.g. mp3duck/employee1

    When you login in via membership provider 1, you would do something like

    // extract the existing prov2ID so you can keep it. GetID() would be a string split function
    string prov2ID = GetID(User.Identity.Name, 2); 
    FormsAuthentication.SetAuthCookie(prov1ID + "/" + prov2ID, false);
    

    And visa versa for a login via membership provider 2.

    If you are using the <asp:login> control, you would modify the UserName propery instead of calling SetAuthCookie() since the login control calls SetAuthCookie() itself.

    You can put any sort of stuff into the Identity name. I often use it to store both a number int ID for the user primary key, and their username. The only downside is you have to clean it up when displaying it in the html. e.g. Hello <% User.Identity.Name %> would display a lot more than you wanted.

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

Sidebar

Related Questions

I have got two models, User and Event. I need two kind of relationship
I've got question to you. I have got two project in PHP that uses
I've got two long lists A and B which have the same length but
I have got two WGS84 coordinates, latitude and longitude in degrees. These points are
I have got two timevalues in the format: %H%M%S (E.G.161500) These values are text-based
I have got two pages. example.com/php.com and example.com. I use this function to set
I have got two input fields which i would like to make editable with
I have got two tables: Event +----------+---------+--------------+ | event_id | name | date |
I've got two models Category and Item. Category can have many items and item
I've got two hard disks in my computer, and have installed Solaris 10u8 on

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.