ZF-11502: Zend_Session_Namespace does not work in chrome browser.
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
$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.
<?php
class IndexController extends Zend_Controller_Action {
}
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 https://bugs.php.net/bug.php?id=51210
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/…
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.