Issue

ZF-11502: Zend_Session_Namespace does not work in chrome browser.

Issue Type: Bug Created: 2011-06-22T20:17:24.000+0000 Last Updated: 2012-03-13T18:51:54.000+0000 Status: Closed Fix version(s): Reporter: Vlad (vlad.vinnikau) Assignee: Adam Lundrigan (adamlundrigan) Tags: - Zend_Session

  • Zend_Session_Namespace

Related issues: Attachments:

Description

Zend_Session_Namespace does not work in chrome browser. The site is sandbox.oggiedomani.org. The navigation choice is saved in session. It works in Firefox 4 and IE 9. However, Chrome browser doesn't store the session. I use Zend Session as following

<pre class="highlight">
$restNamespace = new Zend_Session_Namespace('explorenyc');
if(!isset($restNamespace->boro)){
    $restNamespace->boro = array();
}
if(!empty($input->do)){
    if($input->do=="add" && !empty($input->val)){
        if($input->obj=="cuisine"){
            $restNamespace->cuisine[$input->val] = 1;
        }

        else if($input->obj=="boro"){
            $restNamespace->boro[$input->val] = 1;
        }
                            
            
        else if($input->obj=="neighborhood"){
            $restNamespace->neighborhood[$input->val] = 1;
        }
        
    }
    if($input->do=="clear" && !empty($input->val)){
        if($input->obj=="cuisine"){
            unset($restNamespace->cuisine[$input->val]);
        }
        else if($input->obj=="boro"){
            unset($restNamespace->boro[$input->val]);
        }
        else if($input->obj=="neighborhood"){
            unset($restNamespace->neighborhood[$input->val]);
        }
    }
    if($input->do=="clearall"){
        unset($restNamespace->cuisine);
        unset($restNamespace->boro);
        unset($restNamespace->neighborhood);
    }
}

Comments

Posted by Vlad (vlad.vinnikau) on 2011-06-26T03:45:56.000+0000

Let me know any suggestions to resolve the problem. The issue is replicated on localhost using wamp. I appreciate your help.

Posted by Markus Hausammann (tharkun) on 2011-07-01T14:55:01.000+0000

This problem also causes Zend_Auth to fail in Chrome under PHP 5.3 only. Login is possible but Zend_Auth::getInstance()->hasIdentity() returns false because of the session problem.

Posted by Markus Hausammann (tharkun) on 2011-07-20T11:07:28.000+0000

Anything going on with this?

Posted by Vlad Vinnikov (vlad.vinnikov) on 2011-07-20T14:02:40.000+0000

Zend session doesn't work well with associative arrays. I got it working with indexed array.

one)){ $one = $test->one; $one = " abc ".$one; $test->one = $one; } else{ $test->one = "hello"; } $this->view->test = $test->one; if(!empty($test->sal)){ $sal = $test->sal; $pos = rand(0, 9); $sal[$pos] = rand(30000, 170000); $test->sal = $sal; } else{ $arr = array(); for($i=0; $i<10; $i++){ $arr[$i] = 1; } $test->sal = $arr; } $this->view->sal = $test->sal; } } Posted by Markus Hausammann (tharkun) on 2011-07-21T15:06:43.000+0000 This is actually a bug in PHP, $\_REQUEST does not contain $\_COOKIE anymore. The php.ini setting request\_order = "GPC" fixes the problem. Posted by Markus Hausammann (tharkun) on 2011-07-21T15:09:06.000+0000 see also Posted by Markus Hausammann (tharkun) on 2011-07-22T11:18:31.000+0000 I was somehow mistaken, the request\_order = "GPC" setting does NOT fix the problem. Posted by Vlad Vinnikov (vlad.vinnikov) on 2011-07-22T13:56:44.000+0000 Another solution is to avoid using session all together. I can pass arguments in the query string instead: [http://example.com/search/…](http://example.com/search?find_desc=burger&ns=1&find_loc=Midtown+East%2C+Manhattan%2C+NY) Posted by Markus Hausammann (tharkun) on 2011-07-22T14:05:23.000+0000 Well, if you use Zend\_Auth that really doesn't help. Posted by Satoru Yoshida (satoruyoshida) on 2011-07-26T14:10:42.000+0000 Set component and auto-reassign. Posted by Sebastian Galenski (galenski) on 2011-09-13T15:29:40.000+0000 heard like a missing favicon.ico. chrome makes a new thread for requesting the favicon.ico. so if you handle 404 requests in a way with updating a session-cookie you will get a new session-id and your visible browser tab session has an other session than the "favicon" request! check your serverlogs and 404 handling. Posted by Rowinson Gallego Medina (rowgm) on 2011-11-29T04:50:28.000+0000 Is there any solution? It's so annoying that all my ZF apps will not work well in Chrome. Posted by Rowinson Gallego Medina (rowgm) on 2011-11-29T06:04:28.000+0000 Yes Sebastian Galenski, I found that problem too. I print the $response object in every preDispatch call in my bootstrap and Chrome always asks for the favicon.ico. Thank you so much! Posted by Adam Lundrigan (adamlundrigan) on 2012-03-13T18:51:54.000+0000 This is not an issue with Zend Framework itself. It is an issue with how Chrome requests favicon files in parallel with the initial GET request.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2019 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts