Page 1 of 1

variable scope

Posted: Tue Jun 30, 2009 11:03 am
by jaco
Hello everyone, general question. I have read that user specified server vars. data is lost when the browser goes to another page and the way to avoid that is to use sessions.

Is that true? If the user is using the back or forward button on his browser, the web page is retrieved from cache, aren't these values also stored it the cache?

Cheers,

Jacques

Re: variable scope

Posted: Tue Jun 30, 2009 11:08 am
by BornForCode
The values manually inserted by the user won't populate the form for example, that's why the best solution (in case of forward/back actions) is to use session. It is not recommended in development to put accent on what user has in his cache since he can easily edit/manipulate the cache in a malicious scope.

I am also sure that the title of the post is not properly chosen, variable scopes refers to something else. http://www.php.net/manual/en/language.v ... .scope.php