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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:07:22+00:00 2026-05-11T16:07:22+00:00

Can you store an image in a PHP SESSION ? I have a multi-step

  • 0

Can you store an image in a PHP SESSION ?

I have a multi-step registration process using PHP on my site. On one of the steps, the users can upload their company logo (image).

The last step is to process their credit card.

So before I write any images to the web server and image location to the database, I want to make sure their credit card is valid and process.

As such, is it possible to temporarily store that image data in the SESSION variable?

If not, how else do people temporaily store image data on forms before committing that data?

  • 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-11T16:07:22+00:00Added an answer on May 11, 2026 at 4:07 pm

    You can but expect memory usage of your session to increase depending on the size of the images. In order to do so, you must save the file contents into a session variable.

    If it is in session data and you have multiple steps after the upload the image will be reloaded (into the session) every page view until the steps are complete.

    I would personally recommend against using the session for holding a binary file. Saving the image on disk into a temporary location until the registration is complete. I would only save the path to the temporary file in session. When the transaciton is completed move it to a proper location and do your db inserts.

    Also, in essence, session data is stored on disk (or db) anyway so you might as well save the image file once then issue a move command once complete.

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

Sidebar

Ask A Question

Stats

  • Questions 135k
  • Answers 135k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer There were some external issues at hand but FYI it's… May 12, 2026 at 6:59 am
  • Editorial Team
    Editorial Team added an answer Doing a little RTFS, Session.pm overrides Catalyst's finalize_headers method and… May 12, 2026 at 6:59 am
  • Editorial Team
    Editorial Team added an answer ? means anonymous users. * means all users. May 12, 2026 at 6:59 am

Related Questions

Today I noticed that a few Google advertisements in an adsence block on one
I am currently developing on an advertising system, which have been running just fine
I have been looking for a while now to find a solution to accomplish
In the context of a web application, my old boss always said put a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.