homepage Welcome to WebmasterWorld Guest from 54.205.193.39
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Session vs Local variable
Effiecency
HeadBut




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

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




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

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




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

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]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved