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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:17:21+00:00 2026-05-29T12:17:21+00:00

I just joined a project, and have been going over the code. We need

  • 0

I just joined a project, and have been going over the code. We need to export a lot of data out to Excel for our internal users. There are roughly 5 people who would have access to this functionality at a given time. In order to output to Excel, here’s what I found:

  • retrieve data from DB, store in $_SESSION
  • show HTML page view of data

  • when the user wants to export

    • retrieve the DB data from $_SESSION
    • create a string in memory of a CSV
    • print the HTTP Headers with Excel as the filetype
    • print out the CSV formatted strings

This storage in $_SESSION is happening even when the user is not going to export. This strikes me as terribly inefficient, since the $_SESSION variable could explode in size, since each of the DB table retrievals can be up to 30MB per table, and the expiration on $_SESSION is set to 24 hours. So potentially, there could up to 5 users in the system, with up to 150MB $_SESSION variables. Sound about right?

Has anyone else ever seen something like this? Is this like a bootleg Memcache? Wouldn’t it be best to just write the data to a flat-file that’s updated once every few hours?

  • 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-29T12:17:21+00:00Added an answer on May 29, 2026 at 12:17 pm

    I do store database some data in session, like ID or small object that I use on every page.

    But when it come to larger dataset that I can’t extract on the fly for each page load, I often prefer to store them in a MEMORY/HEAP table ( or a temporary file ), and just store an ID in the session so I’ll be able to extract them easily.

    You might want to take a look at this question about session max size:
    Maximum size of a PHP session

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

Sidebar

Related Questions

I have just joined a on going project based on spring framework. It usage
I have just joined a project with a rather large existing code base. We
I just joined a project where they have been using SQLite. I am more
The project that I have just joined uses the command pattern quite extensively for
I am working on a data warehousing project, and therefore, I have been implementing
I have just joined a project which require working on ARM based micro-controllers.. i
I have just joined a project that has a connection string which is defined
Our customer has just joined the iOS Developer Enterprise Program. They have signed the
I just joined a new C++ software project and I'm trying to understand the
I've just joined a team which has been working in a main-always mode for

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.