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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:03:03+00:00 2026-05-25T20:03:03+00:00

I use $_SESSION for authentication of users, but I was thinking about storing other

  • 0

I use $_SESSION for authentication of users, but I was thinking about storing other variable in session too. However, I have no idea how much session may use resources on the server. I mean is it harmful to have session_start() on every page, as session will be started even when is not needed?

Is it good or bad or neutral to start session on every visit?

  • 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-25T20:03:03+00:00Added an answer on May 25, 2026 at 8:03 pm

    Yes, session_start() consumes resources. However, unless your site has huge amounts of traffic, not so as you’d notice. And the alternative ways of storing session data are nearly all a lot harder to implement, and tend to have interesting failure modes.

    The only thing I’d recommend is to be careful about what you do put into the session – huge amounts of data will have a noticable impact even with lower levels of traffic. The classic mistake is to accidentally load the entire object tree for your business logic layer into your session state.

    For instance, assume you’re building a shopping cart; when the customer clicks “add to basket”, you want to remember the item they added. So, you could add the item’s unique ID into the session, but then you have to look up price and description every time you show the basket, which is a pain. So, you decide to load an object representing the item into your session. This object contains price and description, but also the item’s category – and all the other items in that category, because your application isn’t using lazy loading. So now, each item in your shopping basket also contains hundreds or thousands of other objects; and before you know where you are, you’ve loaded pretty much your entire database into the session.

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

Sidebar

Related Questions

I am trying to use PHP session without using cookies. I have enabled session.use_trans_sid
I've recently inherited an application that makes very heavy use of session, including storing
CFMX 8 Enterprise I have turned on the Use J2EE session variables setting under
I would like to be able to use the same Session variable when transferring
I have a web application that makes heavy use of the Session state to
I have a web application (PHP, but doesn't matter). It uses LDAP for authentication
I have some Ruby web apps that use OpenID for authentication and store the
i have users who can logon to my site. I don't use the asp.net
I am confused about authentication with BlazeDS. Most of the few examples I have
I have a Rails application for which I use devise to authenticate my users

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.