By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,969 Members | 2,360 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,969 IT Pros & Developers. It's quick & easy.

Persistent global variable?

P: n/a
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.

Sep 27 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
ho******@gmail.com 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.

--
Oli
Sep 27 '06 #2

P: n/a
David Gillen said the following on 27/09/2006 17:22:
An noise sounding like Oli Filth said:
>ho******@gmail.com 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
Sep 27 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.