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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T13:09:28+00:00 2026-05-22T13:09:28+00:00

I have 3-tiers (UI, BLL, DAL), those BLL and DAL reside on external WS,

  • 0

I have 3-tiers (UI, BLL, DAL), those BLL and DAL reside on external WS, obviously my membership user works on the UI tier.

So… I was trying to store in my Bussines tables the username for the differents tasks (like a CRUD)

  • Insert registry (username: nicolas)
  • Delete registry (username: peter)
    etc…

The simplest way is send the username on ALL methods and store in the differents tables. But this idea is not scalable and very dirty if you have a lot of bussines tables.

Any know another way to do this? I read about writing a custom membership provider to store the differents user on cache and retrieve from this. But i don’t know if this is the best workaround.

Any ideas?

  • 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-22T13:09:29+00:00Added an answer on May 22, 2026 at 1:09 pm

    The custom controls for ASP.NET rely on the Membership library in System.Web (more specifically, System.Web.Security). As long as you are using those controls (for example, the <asp:Login> control) you already have a dependency on System.Web. In that case, any layer of your application can do something like this to retrieve the current user:

    using System.Web.Security;
    ...
    MembershipUser user = Membership.GetUser();
    

    Then use user.UserName to retrieve the user’s username.


    UPDATED to reflect the understanding that the layers are hosted on separate servers.

    I would add a StartSession() method to the BLL that takes the username as a parameter, and returns a string session ID. The BLL on the server generates the session ID (perhaps using a Guid) and uses the BLL-side cache to save the username. Then on the client side, set a cookie that contains the session ID. It will get submitted along with the web request. (Depending on how you submit the web request, you may have to set the cookie value with javascript.)

    That way you don’t have to modify the signature of your methods, but can still get ahold of the username from the BLL by using the cache. You will have to make sure your login page calls the GetSession() method, and sets the session cookie before submitting more requests.

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

Sidebar

Related Questions

I am trying to build a three tier architecture with UI, BLL, and DAL.
I have a 3-tier application with Data access, service and presentation tiers. Where should
I have an n-tier application with the different tiers running on different machines. I
Suppose you have three tiers (with namespaces): User interface ( App.UI ) - calls
I have a 3 tier win forms app, it has a UI, BLL and
Supposing a classic 3 tier application. In DAL, you have a GenericRepository where T
I have seen n-tiers solutions on the web, they all use DLLs for each
I have an n-tier application design problem with Entity Framework 4. Server-side, my application
I have a three tier system, SQL Server backend, hand written data access layer,
I have a three-tier Windows Forms DB application in VB.NET. I'm using VS 2005.

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.