lead2gold Posted March 22, 2006 Share Posted March 22, 2006 What is the limit as to how much you can store in a $_SESSION variable once a session has been started?I havn't hit the limit yet (whatever that is), but i do tend to store information i should probably reconsider doing. Currently i store it as: $_SESSION['user_id'] = <Currently logged in Users RIN #> $_SESSION['axs_id'] = <Access Level >now the above i consider pretty standard... it's whats below that has me worried.I allow the expanding and collapsing of tables by clicking a {+/-} listing information below.. ie: $_SESSION['user_list']['Admin']= {0/1} $_SESSION['user_list']['Reg']= {0/1} $_SESSION['user_list']['Guest']= {0/1} $_SESSION['team_list']['<team name here>']= {0/1} $_SESSION['team_list']['<team name here>']= {0/1} $_SESSION['team_list']['<team name here>']= {0/1} .... etcWith enough expand/collapse pages and having a user visit each one (thus populating alot of the $_SESSION variable with memory tracking)... could i potentially exceed the Session Limit? Quote Link to comment Share on other sites More sharing options...
redbullmarky Posted March 22, 2006 Share Posted March 22, 2006 nothing in computing is limitless, however i have (so far) found no reason to worry about the size of session data. storing the odd character here, number there, etc,will not really amount to enough to cause major problems.when a session is started, a file is created on the server which holds your info. when your session expires (or you close your browser) the session file ceases to exist.if i'm honest, i'm not sure if there is any 'set' limit on session size. if their isn't, then the size would be determined by how much space is actually used by all of the session files on the server.if youre that worried about how much you store, then simply look through your code and see if you are storing info that NEEDS to be stored (ie, preloading an entire database wouldnt be advisable). user info, users settings, etc are fine. but entire lists of teams and team data would probably be better on your server if they were read from the database as required, rather than stored. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.