Connecting Tech Pros Worldwide Help | Site Map

Can variables be shared across sessions?

  #1  
Old September 30th, 2005, 08:15 PM
C16
Guest
 
Posts: n/a
Hi All

Another newbie question. I have a small website working via php and all is
fine, but I wanted to add some new features and was wondering if php allows
for variables to be seen by multiple sessions, ie a user viewing the web
site on one machine can see variables created by another users session. Is
that what $_SERVER[] is for, or am I going to be better of creating a single
entry table in mySQL that has a field for each global variable?

Many thanks


  #2  
Old September 30th, 2005, 08:45 PM
Andy Hassall
Guest
 
Posts: n/a

re: Can variables be shared across sessions?


On Fri, 30 Sep 2005 19:04:14 +0000 (UTC), "C16" <noone@nowhere.com> wrote:
[color=blue]
>Another newbie question. I have a small website working via php and all is
>fine, but I wanted to add some new features and was wondering if php allows
>for variables to be seen by multiple sessions, ie a user viewing the web
>site on one machine can see variables created by another users session. Is
>that what $_SERVER[] is for, or am I going to be better of creating a single
>entry table in mySQL that has a field for each global variable?[/color]

$_SERVER does not do this; it contains various bits of request information,
but does not persist between requests.

A database would be an appropriate choice for this.
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
  #3  
Old September 30th, 2005, 10:55 PM
C16
Guest
 
Posts: n/a

re: Can variables be shared across sessions?


Thanks Andy, global table added and working nicely :)

"Andy Hassall" <andy@andyh.co.uk> wrote in message
news:a75rj1pdrnf3t95pov177ih5k58hj5vlcv@4ax.com...[color=blue]
> On Fri, 30 Sep 2005 19:04:14 +0000 (UTC), "C16" <noone@nowhere.com> wrote:
>[color=green]
>>Another newbie question. I have a small website working via php and all is
>>fine, but I wanted to add some new features and was wondering if php
>>allows
>>for variables to be seen by multiple sessions, ie a user viewing the web
>>site on one machine can see variables created by another users session. Is
>>that what $_SERVER[] is for, or am I going to be better of creating a
>>single
>>entry table in mySQL that has a field for each global variable?[/color]
>
> $_SERVER does not do this; it contains various bits of request
> information,
> but does not persist between requests.
>
> A database would be an appropriate choice for this.
> --
> Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
> http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool[/color]


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with public variables Jose Meireles answers 2 November 22nd, 2005 05:55 AM
Session Variables getting cross threaded Randy answers 9 November 19th, 2005 08:34 PM
Problem: Module's Friend variable shared across user sessions answers 2 November 18th, 2005 10:14 PM
Problems with public variables Jose Meireles answers 2 July 21st, 2005 11:11 AM