|
Posted by Geoff on 09/06/07 09:05
"eliran" <eliran.g@gmail.com> wrote in message
news:1189067652.256575.72540@19g2000hsx.googlegroups.com...
> On Sep 5, 11:16 pm, Ian Hobson <ian.hob...@ntlworld.com> wrote:
>> eliran wrote:
>> > I am new user in PHP
>>
>> > is there in PHP a mechanizm to keep vaiables (or arrays)
>> > so on each new client request
>> > I can see previous values I kept in previous client request ?
>>
>> > something like internal 'database' ?
>>
>> > rgrds
>> > EL
>>
>> Yes - they are called session variables. See CXLIX. Session Handling
>> Functions in the manual :)
>>
>> You have to start the session (e.g. by calling session_start();) which
>> creates the super global $_SESSION and populates it with the variables
>> your saved there from last visit by this browser.
>>
>> Note - the session is controlled by a cookie, so it refers to the
>> browser invocation, not a window.
>>
>> If you want something stored that is unique to a window, it - or an
>> identifier so you can get it back - has to go into a hidden field in the
>> form.
>>
>> Warning - You should (IMHO) turn off the option in php.ini that permits
>> sessions to be controlled by the URL, because it is too easy for
>> sessions to be hi-jacked when the URL is bookmarked or copied. This will
>> mean that the session mechanism will only work if your visitors haven't
>> turned off cookies completely.
>>
>> Regards
>>
>> Ian
>
> Ian,
>
> 1.
> the SESSION global may help.
> to handle the client session ID + it's variables.
>
> I mean something just for server variables handling, no connection to
> clients
> so is it possible to handle server only global variables
> like to save last used tcp port or calculate some total entries
> and of course much more.
>
> rgrds
> EL
>
>
sorry if this is bit basic
but isn't session in php just a ermm, API type thing using cookies ?
http is stateless, you can't track connections so easily
and you can't just confirm identity by tracking source ip and port etc,
becuase you could get connections from a diff source ip from the same client
(http proxys)
unless it's not identity you want to track, debugging ?
you could save stuff to a file or database, then dig it up again on the next
request
??
Navigation:
[Reply to this message]
|