I need to store a big array during the session (currently up to few kB, and I'd limit it to 0.25MB max).
In your opinion and practice, is it better to store it in $_SESSION or in database?
Speed matters, but so does processor/memory usage, as it's on shared host, and I wouldn't want them to shut the site down for resource overuse.
Would you say there's a size range in which $_SESSION can be used with confidence it will work well? (For example 0kb-100kB or whatever your practice/tests showed).
Thanks.
0.25MB with a sane number of sessions will use less resources if stored in the Session, than in the DB. So the likelyhood of resource overusage is lower with the session.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With