p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: By session_register() or by db querry, the most effective?


Message #1 by "John Arbon" <subscriptions@c...> on Sat, 4 May 2002 01:27:37
Is there a more effective and efficient way of passing values from page to 
page of the two methods that I know about:

Passing client customizing variables through session_register(),

or 

Doing a db query for each page,

or

Is there a better way that I haven't learned about?

John
Message #2 by "Nikolai Devereaux" <yomama@u...> on Fri, 3 May 2002 17:52:40 -0700
Using custom sessions, you're already essentially serializing the data and
using a db query for each page.

Using built-in sessions, you're serializing the data and writing them to a
file for every page.

Might as well stick with session_register and it'll handle the passing data
around pages stuff for you.

nik

Message #3 by "John Arbon" <subscriptions@c...> on Sat, 4 May 2002 02:38:00
Nik,

Using custom sessions, do I need to call the session_register() function 
in each page for each variable that I am passing?

John



> 
Using custom sessions, you're already essentially serializing the data and
using a db query for each page.

Using built-in sessions, you're serializing the data and writing them to a
file for every page.

Might as well stick with session_register and it'll handle the passing data
around pages stuff for you.

nik

Message #4 by "Nikolai Devereaux" <yomama@u...> on Fri, 3 May 2002 18:35:30 -0700
> Using custom sessions, do I need to call the session_register() function
> in each page for each variable that I am passing?

The only difference between built-in session handling and custom session
handling is how the PHP engine manages writing the variables.

All the code that USES sessions remains the same -- Your site doesn't care
HOW PHP happens to "session_register()" a variable, it just knows that
somehow, it DOES.

So the answer is yet -- you still need to call all the session_xxx functions
to manage session vars.

nik


  Return to Index