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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:22:14+00:00 2026-05-23T10:22:14+00:00

I built a strongly typed session object that looks like this: class MySession {

  • 0

I built a strongly typed session object that looks like this:

class MySession
{
  public string UsedID {get;set;}
  public List<int> ListOfInt {get;set;}
  public List<string ListOfString {get;set;}
  .....
}

I’m currently using InProc session so when a page loads, I write:

MySession TheSession = Session["UserSession"] as MySession;

and then later in the code I can access each property with TheSession.XYZ syntax.

This is really cool but I’m thinking that it might be better to store the session in the DB.

I’m thinking about serializing the MySession object in a json string and store the string in a DB that I can retrieve and deserialize when a page loads.

Is this a good way to do it?

Thanks for your suggestions.

  • 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-23T10:22:14+00:00Added an answer on May 23, 2026 at 10:22 am

    First of all make sure you need all the data in Session. I sense that you rather need to create database tables and store data in the tables.

    If you are sure that you need Session, then it would make sense to use standard <sessionState mode="SQLServer">. You can read more about Session-State Modes here.

    If you are sure you want custom serialization, then it would make sense to use binary serialization instead of JSON. It will need less memory to store and less resources to serialize/deserialize.

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

Sidebar

Related Questions

If i have a ViewModel like this: public class MyViewModel { [UIHint(SomeTemplate)] public ICollection<SomeViewModel>
I built a UserControl with a dependency property like this: public MyUserContol() { InitializeComponent();
When implementing error-handling using the built-in validation-helpers on a strongly-typed view, you usually create
In .NET you can create strongly-typed configuration sections using build-in base classes that do
Im trying to get my strongly typed master page to work in my ASP
is there any way to re-build a strongly typed view when the model class
I built a Winform app several months ago that schedules appointments for repair techs.
I'm trying to build a strongly-typed dataset in ADO.Net and am having a little
There's no strongly typed View() method to return an ActionResult. So, suppose I have
Following on from this question , I'm using a simple ViewModel class to test

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.