Re: Re: Sessions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 15 Sep 2008, at 17:03, ANR Daemon wrote:
Plus you can access and manipulate the session array just like you could any
other array.

Pure truth.

No it's not. Please see my earlier response to the OP - there are restrictions that do not exist for normal arrays.

-Stut

Stut is right this is a note from the manual for e.g.:

It is currently impossible to register resource variables in a session. For example, you cannot create a connection to a database and store the connection id as a session variable and expect the connection to still be valid the next time the session is restored. PHP functions that return a resource are identified by having a return type of /resource/ in their function definition. A list of functions that return resources are available in the resource types <http://uk2.php.net/manual/en/resource.php> appendix.

http://uk2.php.net/manual/en/function.session-register.php

Not to mention that you cannot register an array into session that is indexed numerically. But you can do that in multi-dimensional arrays in bigger than the first level indexing if that is the right term. For e.g. you can do this:

$_SESSION['test'][1] = 14;
$_SESSION['test'][2] = 'string';

But you can't do this:

$_SESSION[1] = 'test';
$_SESSION[5] =3;

It probably wont work. Not tested though.

--
Thodoris


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux