views:

45

answers:

2

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.. 
A: 

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

Rick de Graaf
Thanks for the heads up.. I out sourced this, and that is they way the work was done, so I tried to go with it.. Not working so great. :)
+1  A: 

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 _

related questions