Consultez la FAQ sur le ZF avant de poster une question
Vous n'êtes pas identifié.
Bonjour, j'éssaie d'instancier une session a chaque identification réussie, mais j'y arrive pas!!
J'ai ajouté ce code au fichier .ini
resources.session.save_path = APPLICATION_PATH "/../data/session" resources.session.use_only_cookies = true resources.session.remember_me_seconds = 864000
Apres authentification réussie, j'ai mis l'instanciation d'une session dans mon controlleur comme suit:
if ($ident && $pw){ //$pw = md5($pw); $result = $user->select() -> where ('id = ?', '$ident') -> where ('pw1 = ?', '$pw'); //$result = $form->getAdapter()->fetchAll($select); /* $result = $form->select() -> where ('id = ?', '$ident') -> where ('pw1 = ?', '$pw');*/ $rows = count($result); if ($rows !== 0){ $usersession = new Zend_Session_Namespace('usersession'); $usersession->nom = $ident; $this->_helper->redirector('recherche', 'index', null, array('nom'=>$ident)); }else $this->view->form = "Identifiant ou Mot de passe incorrecte"; }else $this->view->form = "Veuillez remplir les deux champs";
le message d'erreur est le suivant :
Exception information: Message: Zend_Session::start() - C:\wamp\www\stage\library\Zend\Session.php (Line:477): Error #2 session_start() [function.session-start]: open(C:\wamp\www\stage\application/../data/session\sess_gesfun7no4bkf0v8e4l9hlc5t3, O_RDWR) failed: No such file or directory (2) C:\wamp\www\stage\library\Zend\Session.php(Line:487): Error #2 session_write_close() [function.session-write-close]: open(C:\wamp\www\stage\application/../data/session\sess_gesfun7no4bkf0v8e4l9hlc5t3, O_RDWR) failed: No such file or directory (2) C:\wamp\www\stage\library\Zend\Session.php(Line:487): Error #2 session_write_close() [function.session-write-close]: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (C:\wamp\www\stage\application/../data/session)
Dernière modification par Yiwen (02-05-2013 13:51:20)
Hors ligne