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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:47:28+00:00 2026-06-08T12:47:28+00:00

I m really sorry for unclear question title but I am a bit confused

  • 0

I m really sorry for unclear question title but I am a bit confused about it myself.

I m running my website on IIS and on the top its displaying the username of the user who is currently logged in. my website is hosted on a local server and various users are accessing it simultaneously.

PROBLEM

Each time a user opens the site it displays the username of the previous user who just recently visited the site.

CODE

This is the code I am using on my global.asax file.

       void Session_Start(object sender, EventArgs e)
    {
        // Code that runs when a new session is started        
        // code to get the current user name when running from IIS
        System.Security.Principal.IPrincipal _User;
        _User = System.Web.HttpContext.Current.User;
        System.Security.Principal.IIdentity _Identity;
        _Identity = _User.Identity;
        string _Value;
        _Value = _Identity.Name.Substring(_Identity.Name.IndexOf(@"\") + 1);

 DataTable dtId = CetDatabase.GetEmployeDetails(_Value);
        if (dtId.Rows.Count > 0)
        {
            Session["teamid"] = dtId.Rows[0]["TEAMID"].ToString();
            Session["projectid"] = dtId.Rows[0]["PROJECTID"].ToString();
            Session["memberid"] = dtId.Rows[0]["MEMBERID"].ToString();
            CeteraQMS.Main_Master.projectname = dtId.Rows[0]["PROJECTNAME"].ToString();
            CeteraQMS.Main_Master.username = _Value;
            CeteraQMS.Main_Master.teamname = dtId.Rows[0]["TEAMNAME"].ToString();
            Session["role"] = dtId.Rows[0]["MEMBERROLE"].ToString();
        }
        else
        {
            Response.Redirect("AccessDenied.aspx");
        }
    }

I am not sure where I m going wrong.

Thanks in advance
Akhil

  • 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-06-08T12:47:29+00:00Added an answer on June 8, 2026 at 12:47 pm

    This here:

    CeteraQMS.Main_Master.username = _Value;
    

    looks like setting a property on a static object. The Main_Master property looks like a static property on the CeteraQMS class (whatever those are). And as you know static objects are shared among all users in the application. So don’t use any static objects to store state that is specific to the current user only. If you want to store the username and other user specific properties, it’s better to store them into the Session, the same way you did with the teamid, projectid, memberid and role values.

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

Sidebar

Related Questions

Really sorry to be asking a bit of an off topic question, but we've
I'm sorry if question title was unclear, but with my cheap english, I cant
Sorry for unclear subject but i really don't understand where problem. I use a
Really stupid question, sorry, but I can't find it on google (I'm sure it's
Sorry if this is a really basic question but it's been really getting to
I am sorry for the title but I really do not know how to
really sorry about being totally thick today but I have forgotten how to do
I'm really sorry. This must seem like an incredibly stupid question, but unless I
Well. i'm really sorry for the fact that this question is easily testable, but
Really sorry for the extremely stupid title, but if I know what it is,

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.