Re: Persistent global variable?



David Gillen said the following on 27/09/2006 17:22:
An noise sounding like Oli Filth said:
howachen@xxxxxxxxx said the following on 27/09/2006 16:49:
Hi,

Are there something like a `Persistent global variable` in PHP?

It is something like `Application` in the classic ASP, all the request
share the same variable, and the die after a timeout.

Sessions.
http://php.net/manual/features.sessions.php

Be aware that sessions are not cross-user though. Each user has their own set of independent persistent variables.

Pass the same session id to session_id() after you start the session should
give you the same session for all users. A bit hacky though. If it even works.
Can't see why it wouldn't though.


Of course, that then presents the users from having any "personal" variables at all...


--
Oli
.



Relevant Pages

  • Re: register_globals - turning on
    ... >>default because of the history of PHP. ... >Sessions contain persistent data, ... >>paths are a tad confusing as well. ... >In the case of session data, the web server needs to be able ...
    (comp.lang.php)
  • Session Variables Disappear and Reappear
    ... New to PHP and I've checked previous posts and haven't seen similar problem. ... I can also destroy sessions. ... message will disappear showing the "Please Login Form". ...
    (php.general)
  • Re: register_globals - turning on
    ... >>an Apache module. ... >So basically using the .htaccess is a safe way of enabling sessions to ... >>Stick this file on the beginning of every PHP page processed. ... >>In the case of session data, the web server needs to be able ...
    (comp.lang.php)
  • RE: [PHP] Clearing POST variable on page refresh
    ... [PHP] Clearing POST variable on page refresh ... Since you don't want to use sessions, ... Less than a week on an ultra busy server. ... This is most likely not a php thing, but would there be a way to refresh the ...
    (php.general)
  • Re: PHP 5 & OO
    ... And say my project has good 70 objects, some of them very large, and a 1000 users concurently browsing. ... So in theory every time a user loads a page I have to load some or all of those? ... PHP application had thousands of concurrent users? ... And you want to access other peoples sessions from within your code? ...
    (comp.lang.php)