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

The Archive Base Latest Questions

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

I come into ASP.NET from php so the reason why i ask my question

  • 0

I come into ASP.NET from php so the reason why i ask my question is because it’s totally different nature of how application works and handles requests.

well, i have an exists table with user creditians, such as:
id, login, password (sha hashed), email, phone, room

i have built custom membership provider so it can handle my own database authentication schema.

and now i’m confused, because User.Identity.Name contains only user’s login, but not the complete object (i’m using linq2sql to communicate with database and i need in it’s User object to work).

at php applications i just store user object at some static method at Auth class (or some another), but here at ASP.NET MVC i cannot do this, because static member is shared across all requests and permanent, and not lives within only current request (as it was at php).

so my question is: how and where should i retrieve and store linq2sql user object to work with it within current and only current request? (after request processed successfully i expect it will be disposed from memory and on next request will be created again).

or i’m following totally wrong way?

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

    If you’ve implemented the MembershipProvider then you know that it has a GetUser method, that gets a MembershipUser object based on a username.

    In any page in your project, if you run Membership.GetUser() it will run the GetUser(username) method in the currently enabled authentication provider. In a simple basic solution this call will go to the db and get the user details every time you access it.

    What I’ve done in my project is store the current user in the Session variable. This way the current browser session for this user will store the user object. It’s simple, and it’s good, because ASP.NET authentication is based on the current session.

    One thing to note – every time the user logs out you should clear that session variable. In my case I use Session.Abandon() just to make sure. Other than that – this is the approach I’ve used so far and it works great!

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

Sidebar

Related Questions

I am fairly new to asp.net and come into a problem whilst using a
I tried implementing a simple web service into an asp.net application using the tutorial
I come from a .NET world and I'm new to writting C++. I'm just
I come from a mainly PHP background and make good use of the Apache
I come from a PHP/Rails background where deploying a website often means FTP/Checkout of
I am using Fluent nHibernate for my persistence layer in an ASP.NET MVC application,
We are currently developing an application based on NHibernate and ASP.NET MVC and a
I've recently come into a web development position with a company who just lost
I come from a Java background, where packages are used, not namespaces. I'm used
I come from the Microsoft world (and I come in peace). I want to

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.