I’m building a multi-page form with PHP. I’m storing most of the value’s in $_SESSION. Using the following method…
$_SESSION['title'] = $_POST['title'];
It’s working fine so far but I’m not sure if it will be able to hold PDFs, videos, ect.
Does the $_SESSION only hold strings & intigers, or can files be stored there?
The maximum size of a $_SESSION is the maximum memory allowed to a PHP script, but chances are if you even get to 1/3 of that, you’re doing something wrong.
$_SESSION, as a rule, should only be used to keep what information is needed by the user for the majority of the site page views. It is highly improbable, that you will actually need a file on each page.Here’s a better option, store a temp file on the disk and assign the path to the temp file in the
$_SESSION. Then, when you need it, read the file to the user.