Session variables vs. repulling data
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Session variables vs. repulling data
Are there limitations or bottlenecks on session variables? I am trying to figure out if it would be a better to store several different session variables at player login so as to save them between pages. The other option I can see is to requery for them on each page needed, and only store the player's name in the session variables. If you could save those MySQL queries (and pulling all the player data is a fairly big one in PBBG terms) for every script access, that could be a large savings, but I don't know if there is some negative to session variables that could negate the pros of using all session variables.
The indelible lord of tl;dr
Re: Session variables vs. repulling data
well usually a session only lasts for about 24 minutes. you would have to alter it in the .htaccess to either last longer, or store sessions in a folder on the server.
i cant find the link i had which explained how to do it all, but if i remember correctly i googled 'extending php sessions'
i cant find the link i had which explained how to do it all, but if i remember correctly i googled 'extending php sessions'
New Site Coming Soon! Stay tuned 
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Session variables vs. repulling data
Hmmm...is WAMP atypical then of web servers, because I can actually close my browser window and come back the next day and I am still logged in with all of my session variables (something I thought was going to be a problem I was going to have to fix)?
The indelible lord of tl;dr
Re: Session variables vs. repulling data
That is probably your browser saving your info, not WAMP.
I told Firefox not to save my info and I have to re-log in every time I open the browser. I stay logged in until I close the browser or click 'logout', but it doesn't remember it when the browser is closed.
I told Firefox not to save my info and I have to re-log in every time I open the browser. I stay logged in until I close the browser or click 'logout', but it doesn't remember it when the browser is closed.
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Session variables vs. repulling data
Ahhh, that makes sense. But doesn't the browser save cookies that only save a session ID? The actual session variable values are stored on the server, right? That was my understanding. If the actual session variables are stored on the client's computer, I have some re-coding to do.OldRod wrote:That is probably your browser saving your info, not WAMP.
I told Firefox not to save my info and I have to re-log in every time I open the browser. I stay logged in until I close the browser or click 'logout', but it doesn't remember it when the browser is closed.
The indelible lord of tl;dr
Re: Session variables vs. repulling data
there are ways of setting up your server to store session variables on there, but it doesnt usually keep them without being told to... or atleast thats how i understand it lol.
although i have just googled it, and seems others have had the same issue of sessions being kept open when a browser is closed (i havnt had that problem though :s)
what browser are you using??
although i have just googled it, and seems others have had the same issue of sessions being kept open when a browser is closed (i havnt had that problem though :s)
what browser are you using??
New Site Coming Soon! Stay tuned 
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Session variables vs. repulling data
I am using Firefox for initial testing.Torniquet wrote:there are ways of setting up your server to store session variables on there, but it doesnt usually keep them without being told to... or atleast thats how i understand it lol.
although i have just googled it, and seems others have had the same issue of sessions being kept open when a browser is closed (i havnt had that problem though :s)
what browser are you using??
EDIT: After doing some checking online, in the PHP manual and a couple of PHP books, I found that session variables are always stored on the server, and only a session ID or cookie is stored on the client-side, depending on how you configure it to be stored in your code (which is how I thought sessions worked). However, more safeguards need to be taken to ensure they are secure, such as using cookies to store session IDs and enabling SSL on your website.
The indelible lord of tl;dr