AJAX store large form progress in SESSION

Hey guys,

I've recently started working on a large form which I update with ajax + php to a database at regular intervals. I read an article the other day which mentioned that they save the form details to a SESSION variable instead and then do one database call to save in the end.

I was thinking is this a bad idea. Having many users store lots of data to a session variable? I just thought I would ask before I change it over.

Well that would depend on how many users you are planning on to be active at once, the system resources available to be allocated to php, and of course what you are storing.

However session data is usually going to be saved either in a text file or database table depending on your php configuration and should clean up inactive sessions so unless you have thousands of users with session data exceeding a couple of KB then it shouldnt be an issue. But what is it that you are wanting to store for the life of the session?

Originally Posted by doush.

Hey guys,

I've recently started working on a large form which I update with ajax + php to a database at regular intervals. I read an article the other day which mentioned that they save the form details to a SESSION variable instead and then do one database call to save in the end.

I was thinking is this a bad idea. Having many users store lots of data to a session variable? I just thought I would ask before I change it over.

Yeah that makes sense. I probably should see how big one text file becomes and see if it will be acceptable. If anything I can give much more memory to php.

Originally Posted by portcitysoftwar

Well that would depend on how many users you are planning on to be active at once, the system resources available to be allocated to php, and of course what you are storing.

However session data is usually going to be saved either in a text file or database table depending on your php configuration and should clean up inactive sessions so unless you have thousands of users with session data exceeding a couple of KB then it shouldnt be an issue. But what is it that you are wanting to store for the life of the session?