I’m creating a multi-step survey and want to store the data in $_SESSION before writing everything to a database. Is there anything I should be doing to the data before storing it there from a security perspective?
I’m creating a multi-step survey and want to store the data in $_SESSION before
Share
Assuming you’re on the regular file-based sessions, then you don’t have much to worry about from an injection vulnerability view. PHP will take care of the mechanics of read/writing the session file, using
serialize()and the like. Stuff whatever you want into $_SESSION and it’ll magically be there on the next page invocation.However, from the broader security perspective, anything that goes into the session file IS readable by anything else running under the same web server instance (e.g. the apache user ID). So it’s not somewhere you could store sensitive data, let along things like credit cart/cvv numbers.