Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [ZendFramework] Zgubiona sesja, w poszukiwaniu....
mrok
post
Post #1





Grupa: Zarejestrowani
Postów: 258
Pomógł: 17
Dołączył: 22.05.2007

Ostrzeżenie: (0%)
-----


Witam


Czy ktoś widzi coś dziwnego w poniższym kodzie? Niby prosta sprawa - logowanie użytkowników, ale lokalnie działa tylko w Operze i FF, a niestety IE7 i Safari gubią sesję (sprawdzałem przez die, a jak chciałem to zrobić przez Zend_Session::setSaveHandler(new Zend_Session_SaveHandler_DbTable() to dostawałem dwa rekordy - drugi pusty), na serwerze nie działa wogóle ;(

  1. <?php
  2. class IndexController extends Mrok_Controller_Action  {
  3.  
  4.    public function init() {
  5.        parent::init();
  6.    }
  7.  
  8.    public function indexAction() {
  9.        $flashMessenger = $this->_helper->getHelper('FlashMessenger');        
  10.        $errorMessage = $flashMessenger->getMessages();
  11.        var_dump($errorMessage);
  12.    }
  13.  
  14.    public function loginAction(){
  15.        if ($this->_request->isPost()){//to sprawdzamy haselko
  16.            $login = $this->_request->getParam('login');
  17.            $pass = $this->_request->getParam('pass');
  18.  
  19.  
  20.            $oUser = null; // to w celach testowych
  21.            if ($oUser == null){ //jesli null to bye bye
  22.                $flashMessenger = $this->_helper->getHelper('FlashMessenger');
  23.                $flashMessenger->addMessage('Niepoprawna nazwa użytkownika lub hasło');
  24.                $this->_redirect('/');
  25.            }    
  26.        }else{
  27.            $this->_redirect('/');
  28.        }
  29.    }
  30. }
  31. ?>


$oUser = null; // to w celach testowych // aby przetestować flashMessengera

  1. <?php
  2. class Mrok_Controller_Action extends Zend_Controller_Action {
  3.  
  4.    public function init(){
  5.        Zend_Session::setOptions( array(
  6.                    'use_only_cookies' => 'on',
  7.                    'remember_me_seconds' => 1800,
  8.                    'name' => 'test'
  9.        ));
  10.        Zend_Session::start();
  11.        $default = new Zend_Session_Namespace();
  12.        var_dump($_SESSION);
  13.    }
  14. }
  15. ?>


Korzystam z ZF 1.7.2

Pozdrawiam
Mrok
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 3.10.2025 - 22:57