Sessions avant ou après déclaration des objets PHP
Bonjour,
Selon l'hébergeur le problème est différent.
Chez infomaniak je dois déclarer mes objets PHP avant de faire un session_start();
Et chez Amen c'est l'inverse, sauf que chez infomaniak ça fonctionne alors que chez Amen non.
Code:
1 2 3 4 5
| <?php
// Import Session
session_start();
// Import DTO
include ('fonctions/dto/clientDTO.php'); |
Chez Amen si je place mon session_start() avant il me met l'erreur suivante car les objets sont déclarés après la session :
Citation:
Fatal error: main() [<a href='function.main'>function.main</a>]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "Client" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /web/.../reservez.php on line 30
Et bien entendu si j'inverse j'ai le message :
Citation:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /web/.../ctrlClients.php:37) in /web/.../reservezSaut.php on line 21
J'avoue que si quelqu'un a eu le soucis, je veux bien un tuyau.
C'est surement un problème de conf mais lequel et comment y remédier ...
Merci