Christopher Shennan's Blog

A day in the life of…

Today I have found a new nemesis in the form of the Zend Framework!  I have been working on a client website that for some reason just will not allow them to log out properly when they’re using IE7 or Google Chrome but it works fine in Firefox (please don’t post the “get a better browser” comments as it’s really not very helpful).

I’ve check the online examples and my logout function is identical, line for line, as the examples.

public function logoutAction()
{
    // clear everything - session is cleared also!

    Zend_Auth::getInstance()->clearIdentity();
    $this->_redirect('/login/index');
}

For some reason in IE7 and Chrome it only seems to execute the logoutAction() function if i do a hard refresh (Ctrl + F5) otherwise it redirect to the login form but the login details do not seem to get erased and I can still access the administration pages as if I am still logged in.

It’s driven me crazy all afternoon and I eventually had to give up for the day and hope that it’ll all become clear tomorrow when my mind is fresh and my coffee is strong!

About Christopher Shennan

I am a web developer specialising in web driven applications using PHP, MySQL, Symfony and Zend and I am currently working for Line Digital in Edinburgh, Scotland.

Most days I can be found frantically coding away with EuroDance in my ears and consuming what I hope to be a never ending supply of coffee... happy days!

Connect with me via Twitter, Google+ or LinkedIn

  • #1 | Written by james kinloch about 3 years ago.

    IE7 has become the bain of my existance with transperancy errors and its seeming inability to read microsofts own code has left me at times in a fuming mess looking at code which “works in everythng else”. I hate it.
    I havent messed to much with Chrome, best to leave some things alone.

  • #2 | Written by Elia C. about 3 years ago.

    I have the same problem, but I think that the problem doesn’t depend from the browser, but it’s a framework problem: once you have done the login, if you have an action (for ex. bigdataAction) that fetch a lot of data from a database, and during the fetch operation (before the page is display) you press F5 to reload the page, the framework automatically call logout action (or clearIdentity() functions).

    If you solve the problem please contact me.

  • #3 | Written by Christopher Shennan about 3 years ago.

    You were right that my problem was not caused by the browser. My problem was caused by a session.cache_limiter value that had been set which was causing the weird behaviour and it was fixed by changing

    ini_set(’session.cache_limiter’, ‘private’);

    to

    ini_set(’session.cache_limiter’, ‘none’);

    I have mentioned this fix on another post related to Zend clearIdentity() and IE7 and Chrome Caching Problems.

Leave a Comment

Subscribe to comments

CommentLuv badge