Re: PHP session variables

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

 



Am 09.08.12 23:16, schrieb Jim Lucas:
> On 08/09/2012 01:45 PM, Tedd Sperling wrote:
>> On Aug 8, 2012, at 5:41 PM, Jim Giner<jim.giner@xxxxxxxxxxxxxxxxxx> 
>> wrote:
>>
>>> On 8/8/2012 11:24 AM, Ansry User 01 wrote:
>>>> I am setting the _SESSION variables in one of my file, but whenever
>>>> I leave the php page session variables are not accessible. Not sure
>>>> what I need to do additionally other then defining _SESSION[].
>>>> Any pointer.
>>>>
>>> You must make it a habit to start each script with
>>>
>>> session_start();
You should definitely not make that a habbit!
Why create/open a session and send a cookie everytime script call even
if you won't need it? Why access a hard disk to create/open a session
file even if there is no use for it?

Only call session_start() if you need it and call session_write_close()
as early as possible to avoid write locks on the users session file.

And up from PHP 5.4 you can use

http://de2.php.net/manual/de/function.session-status.php

to check a session status.

-- 
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3

Tel.: 0174 / 9722336
e-Mail: marco@xxxxxxxxxx

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz


Attachment: signature.asc
Description: OpenPGP digital signature


[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