Re: clases en sesiones

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

 




deinet wrote:
> Hello list, i have a problem with sessions and class. I used to work with a
> server with session.auto_start=Off, and now I had to move all my sites to
> another server with session.auto_start=On, and I have this problem with the
> session:
> 
>  
> 
> Fatal error: Unknown(): The script tried to execute a method or access a
> property of an incomplete object. Please ensure that the class definition
> carrito of the object you are trying to operate on was loaded _before_ the
> session was started in <archive> on line 43
> 
>  
> 
> The problem is the class is charged after the beginning of the session, but
> I don't know what to do to make it work, please help me.
> 
>  
> 
> P.D.:  To put the session.auto_start in Off is not a solution because the
> servers administrators don't admit that.

they are then a$$holes - to put it not so politely, session.auto_start=On is
a crazy setting to have as default. find a different webhoster if you can.

you might try using a .htaccess to override the default php.ini setting
(assuming this is an apache webserver) put an .htaccess file in the webroot
and add this to it:

php_value	session.auto_start	Off

that might not work because they are even so stupid as to block changing of this
setting.

if it doesn't work you can try one more thing, namely an 'auto_prepend_file',
again you define this in an .htaccess in the root of your site.

php_value	auto_prepend_file	/path/to/your/auto_prepend_file.php

then you add the relevant include/require lines (lines that load the files that
contain the class definitions of the classes that you use/store in your sessions)
to the php file pointed to by auto_prepend_file. the auto_prepend_file file is run
before anything else is done - including *HOPEFULLY* the sessiohn being automatically
started - I have not tested this and if the session is started before the
auto prepend file is loaded then you are shit out of luck with this option.

hope that works for you.

> 
> I hope you will understand my problem, sorry for my english.
> 
>  
> 
> Thank you very much, Carlos.
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[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