Connecting Tech Pros Worldwide Help | Site Map

Sharing session variables?

  #1  
Old March 12th, 2008, 11:45 PM
Gilles Ganault
Guest
 
Posts: n/a
Hi

A friend of mine use PHP sessions to keep track of user data on the
server. The problem is that some of the SELECT queries are common to
all users, but apparently, session data cannot be shared among users.

Is there a way to share the output of a SELECT?

Thank you.
  #2  
Old March 12th, 2008, 11:55 PM
ZeldorBlat
Guest
 
Posts: n/a

re: Sharing session variables?


On Mar 12, 6:41 pm, Gilles Ganault <nos...@nospam.comwrote:
Quote:
Hi
>
A friend of mine use PHP sessions to keep track of user data on the
server. The problem is that some of the SELECT queries are common to
all users, but apparently, session data cannot be shared among users.
>
Is there a way to share the output of a SELECT?
>
Thank you.
Session data typically can't be shared between users -- that's one of
the reasons they're very effective.

Just store the result somewhere else. You can serialize it and write
it to a file or use something like memcached. Then you just check if
the result you're looking for is in the cache. If it is you use it;
if it isn't you hit the database then store the result.
  #3  
Old March 13th, 2008, 12:05 AM
Gilles Ganault
Guest
 
Posts: n/a

re: Sharing session variables?


On Wed, 12 Mar 2008 15:47:37 -0700 (PDT), ZeldorBlat
<zeldorblat@gmail.comwrote:
Quote:
>Just store the result somewhere else. You can serialize it and write
>it to a file or use something like memcached.
I'll read up on serializing data, or using a Memcached daemon. Thanks.
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
PROBLEM: Browsers Sharing Session Variables Godot answers 2 November 28th, 2005 07:25 PM
Sharing Session variables with ASP pages? Selden McCabe answers 3 November 18th, 2005 05:43 PM
Sharing Session variables across applications Cowboy \(Gregory A. Beamer\) answers 4 November 18th, 2005 01:51 AM
Sharing session variables Mladen Gogala answers 3 July 17th, 2005 06:38 AM