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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:58:06+00:00 2026-06-01T09:58:06+00:00

I’ve started looking at re-writing some pages on a clients website and I can

  • 0

I’ve started looking at re-writing some pages on a clients website and I can see that for example as soon as somebody logs in there are 53 Sessions variables set.

To me this seems crazy to set everything as soon as you login and then throughout the website either refer back to these sessions or add new ones.

More often than not their site receives errors because one of the many Sessions has lost its value.

So my question is what is the best way of re-doing these pages.

  1. Is it a good idea to continue using this amount of Sessions?
  2. Is there a better alternative of using the Sessions?
  3. There are some variables that are needed on ALL pages on the site so is it better to retrieve these from the Database on each page or set these in a Session?

I believe that there should only be one Session needed and that is the USERNAME/USER-ID and everything else should be grabbed from the database as and when it is needed.

Thanks in advance

  • 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-01T09:58:07+00:00Added an answer on June 1, 2026 at 9:58 am

    It’s generally not a good idea to use session so heavily, but it depends on what kind of data is being stored there. If it’s a bunch of string and integer values it’s probably not too much of a concern, but if they’re storing robust objects and/or large sets of data in session, I would definitely look into refactoring it.

    As a rule of thumb, I try to avoid using session for anything other than user-related data. It can be tempting to use session for purposes other than this, but with a good design and implementation you shouldn’t really need to.

    Here are a couple of guiding principles on where to store things:

    • For data that is user-specific and is accessed frequently throughout the application, utilize session to reduce trips to the database

    • For data that is more or less static and not dependent on or related to the user, utilize cache or application state to reduce trips to the database

    • For data that is page-specific, utilize ViewState and/or hidden fields. However, do not use ViewState to store large objects or sets of data

    • For data that is considered safe for users to see, consider using QueryString to pass information from page to page

    The above principles will usually guide you in the right direction, but as with anything there are exceptions. Just be thoughtful of where you’re storing data and why you’re storing it there, and you should be fine.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into

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.