zend session expires when refreshed many times

2019-02-20 04:03发布

问题:

Zend Gurus:

I have a problem that my session expires if I refresh a page many times quickly .. ?

I log into my site, after I'm logged in, I just press F5 many times quickly, and my session expires. I'm no expert, but it's troubling to me.

Should I just abandon Zend Session(s) ?? Any ideas.. ?

Thank you everyone,

-P

This is how I check if I User is logged in ..

public function isloggedin() {
    $session = Zend_Registry::get('session');
    if ($session->login) {
        return (1);
    }
    else {
        //Application_Model_System::rr_log( "not Logged in");
        return 0;

    }


}

BootStrap.php

This is one of the first lines in my bootstrap

Zend_Session::start();
Zend_Session::rememberMe(864000); // How long the sessions will last
//StackOverFlow is great.. 

回答1:

Why don't make use of Zend_Auth for logging in users? I can refresh a billion time and still keep logged in.



回答2:

Some how I got Zend sessions working.. I don't know exactly what I changed, but I banged on it for hours, and suddenly it worked.. Here is what I used.

I hope this can help others,

require_once ('Zend/Loader.php');
require_once ('Zend/Session.php');


Zend_Session::setOptions(array('save_path'=>APPLICATION_PATH.'/sessions/'));

Zend_Session::start ();


$session = new Zend_Session_Namespace('session');
Zend_Registry::set('session', $session);

Thanks StackOverFlow _