Welcome to WebmasterWorld Guest from 54.226.189.112

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Session vs Local variable

Effiecency

     

HeadBut

5:22 am on Apr 6, 2007 (gmt 0)

10+ Year Member



I would like to internationalize my application. I'm looking at setting a bunch of variables in an include file. Should I use $_SESSION Variables or $Local variables. Which it more effecient and what are the drawbacks? Is my approach flawed? Is there a limit to the number of $_SESSION Vars I can use?

Thanks! (B)

eelixduppy

5:49 am on Apr 6, 2007 (gmt 0)

WebmasterWorld Senior Member eelixduppy is a WebmasterWorld Top Contributor of All Time 5+ Year Member



If you are going to want access to different variables across the site you are going to want to use sessions [php.net] and not regular local variables. After all, this is what they are for ;)

>> efficiency

I'd say that both are pretty much going to have the same efficiency.

As for the limit of sessions, I'm not quite sure, but I believe it varies from browser to browser.

whoisgregg

1:11 pm on Apr 6, 2007 (gmt 0)

WebmasterWorld Senior Member whoisgregg is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Is there a limit to the number of $_SESSION Vars I can use?

Storing an excessive amount of data in the session can dramatically slow down your page loads. Read jatar_k's experience with this issue. [webmasterworld.com]

 

Featured Threads

Hot Threads This Week

Hot Threads This Month