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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:15:19+00:00 2026-05-18T21:15:19+00:00

I am reviewing some web code and I am not exactly sure how ASP.net

  • 0

I am reviewing some web code and I am not exactly sure how ASP.net session state works. Any helps would be gratefully appreciated.

If a User object is saved to the session state during login, and User.FirstName and User.LastName is set. If other web pages retrieve the user object from the session and set the FirstName to something else is that persisted on other web pages? Or, do you need to re-add the user object back to the session once it has been modified? Thanks

  • 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-18T21:15:20+00:00Added an answer on May 18, 2026 at 9:15 pm

    Session is persisted on the server, but tracked via the client. I repeat – via the client.

    In most cases, sessions are tracked with cookies. So using your example, when User object is saved to Session:

    Session["UserInfo"] = new User { FirstName = "Joe", LastName = "Bloggs" };
    

    A cookie will be sent to the client with a unique identifier. This cookie is passed along to all further HTTP requests from this client/browser unless it expires.

    If another user comes along (from a different machine) for the first time, Session["UserInfo"] will be null.

    An alternative to cookies is “cookieless-session” – where instead of using a cookie to store the session identifer – the identifier is tacked onto the URL.

    So the answer is no – other web pages (e.g other clients/machines/browsers) will not have access to this information.

    If you want information shared between different clients from the web server, use Cache.

    However given the context of the question (User information), it is valid to store this information in the Session, as it is only relevant to a particular user (shouldn’t be shared).

    An alternative a lot of people use instead of sticking the User info in the session, is to put it in a generic principle which get’s attached to the Forms Authentication ticket.

    Up to you which road you choose.

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

Sidebar

Related Questions

I was just reviewing some old code and found the following (inside foo.asp): Const
I'm reviewing some code for a friend and say that he was using a
We have a software house developing code for us on a project, .NET Web
I am currently reviewing some code for colleagues on a different project and they
I was reviewing some SQL queries and I saw a select statement that looked
I am reviewing a big java application to see if there are any performance
I'm code reviewing a change one of my co-workers just did, and he added
I recall reviewing someone else's PHP code once and he had a function or
Without spending a long time reviewing the boost source code, could someone give me
I am reviewing a Linux based perl web application that contains a login handler

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.