{"action":"created","issue":{"url":"https://api.github.com/repos/zendframework/zf2/issues/4821","labels_url":"https://api.github.com/repos/zendframework/zf2/issues/4821/labels{/name}","comments_url":"https://api.github.com/repos/zendframework/zf2/issues/4821/comments","events_url":"https://api.github.com/repos/zendframework/zf2/issues/4821/events","html_url":"https://github.com/zendframework/zf2/issues/4821","id":16705486,"number":4821,"title":"Zend\\Session does not play nice with upload_progress","user":{"login":"mwillbanks","id":38209,"avatar_url":"https://avatars.githubusercontent.com/u/38209?v=3","gravatar_id":"","url":"https://api.github.com/users/mwillbanks","html_url":"https://github.com/mwillbanks","followers_url":"https://api.github.com/users/mwillbanks/followers","following_url":"https://api.github.com/users/mwillbanks/following{/other_user}","gists_url":"https://api.github.com/users/mwillbanks/gists{/gist_id}","starred_url":"https://api.github.com/users/mwillbanks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwillbanks/subscriptions","organizations_url":"https://api.github.com/users/mwillbanks/orgs","repos_url":"https://api.github.com/users/mwillbanks/repos","events_url":"https://api.github.com/users/mwillbanks/events{/privacy}","received_events_url":"https://api.github.com/users/mwillbanks/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/zendframework/zf2/labels/Session","name":"Session","color":"008000"}],"state":"open","locked":false,"assignee":{"login":"mwillbanks","id":38209,"avatar_url":"https://avatars.githubusercontent.com/u/38209?v=3","gravatar_id":"","url":"https://api.github.com/users/mwillbanks","html_url":"https://github.com/mwillbanks","followers_url":"https://api.github.com/users/mwillbanks/followers","following_url":"https://api.github.com/users/mwillbanks/following{/other_user}","gists_url":"https://api.github.com/users/mwillbanks/gists{/gist_id}","starred_url":"https://api.github.com/users/mwillbanks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwillbanks/subscriptions","organizations_url":"https://api.github.com/users/mwillbanks/orgs","repos_url":"https://api.github.com/users/mwillbanks/repos","events_url":"https://api.github.com/users/mwillbanks/events{/privacy}","received_events_url":"https://api.github.com/users/mwillbanks/received_events","type":"User","site_admin":false},"milestone":null,"comments":11,"created_at":"2013-07-12T22:36:31Z","updated_at":"2015-05-22T16:38:18Z","closed_at":null,"body":"aydin\r\n2:40 Can anyone help with this? Happens after form submission. Form is validated (and passes) via ajax. Then the page is redirected. During page redirection load this error is received: http://pastebin.com/EanZ92UT. If I reload the page it loads fine however, I am logged out from zfcuser and using developer toolbar I am once again a user with the guest role. The error is only seen after submitting\r\n2:40 the form, never again.\r\naydin\r\n2:43 :D\r\nmwillbanks\r\n2:44 aydin: what version of zf are you using?\r\n2:44 ocramius: yeah… session makes me angry :)\r\n2:44 i love the session but i have a profound hate for it as well\r\naydin\r\n2:45 mwillbanks: 2.2.0\r\nmwillbanks\r\n2:45 if we stayed away from arrayobject everything would be fine\r\n2:46 aydin: you are using 5.3.3 huh\r\n2:47 ok so basically here is the basic part of what is going on\r\n2:47 your session was corrupted\r\naydin\r\n2:47 mwillbanks: 5.4.9\r\nmwillbanks\r\n2:47 how it was corrupted i have no idea at the moment\r\n2:47 but it failed to unserialize the result\r\n2:47 which then passed null to the exchangeArray\r\naydin\r\n2:48 mwillbank: it happends only when my form iis submiitted :(\r\nmwillbanks\r\n2:48 so you said there was something with ajax in there\r\nmwillbanks\r\n2:48 are you passing it via ajax back to your controller?\r\n2:48 in that ajax call how are you manipulating the session basically is what i am wondering :)\r\naydin\r\n2:49 forget the ajax, it does it without it also :/\r\nmwillbanks\r\n2:49 really?\r\naydin\r\n2:49 yup, i disabled it earlier\r\nmwillbanks\r\n2:49 could you pastebin your session configuration?\r\n2:49 are you using upload progress anywhere?\r\n2:49 apc, zend opcache, etc?\r\n2:49 php version\r\naydin\r\n2:49 i've not modified the session config, standard zfcuser + bjy\r\nmwillbanks\r\n2:49 hrm\r\naydin\r\n2:50 but yes upload progress\r\nmwillbanks\r\n2:50 ugh; upload progress has seemingly been causing some folks issues\r\n2:50 does that form have upload progress on it?\r\naydin\r\n2:50 yeah, im sure I disabled it though and was still getting the exception. 1 sec i'll check\r\n2:51 yeah I commmented out the progress action, however, may it being enabled in php.ini be causing problems?\r\n2:52 i'll check\r\nmwillbanks\r\n2:52 yeah i'd try disabling it and seeing if that solves it… then it atleast gives me an area to start looking deeper into the issue\r\naydin\r\n2:54 mwillbanks: damm that fixed it\r\naydin\r\n2:54 try and do cool new things and it doesn't work :(\r\n2:54 this php problem then?\r\nmwillbanks\r\n3:13 aydin: not exactly\r\n3:13 aydin: could you try this...\r\n3:13 wait...\r\n3:13 nm\r\n3:14 so here is what i think is happening\r\n3:14 when the upload progress happens; it opens up and manipulates the session; but it does not go through the normal session handler\r\n3:15 when it puts the data into the session it then stores it corrupting the session state\r\n3:15 zend\\session attempts to read in the session and unserialize it\r\n3:15 resulting in the corruption due to the set being different than how upload progress saved it in\r\n3:16 now how in the hell that happens; is unknown to me.  i'll likely have to dig pretty deep to figure it out\r\naydin\r\n3:23 mwillbanks: damm, anyway I can help? Should I open an issue or something?\r\nmwillbanks\r\n3:23 aydin: absolutely you can help… do you understand php src at all?\r\n3:23 :)\r\naydin\r\n3:27 mwillbanks: no, I don't know the php src :/\r\nmwillbanks\r\n3:27 yeah so i think i kind of figured it out… how i am going to fix this… well that is a whole different story\r\n3:27 http://lxr.php.net/xref/PHP_5_4/ext/session/session.c#2250\r\n3:28 so; on php shutdown session gets saved right… well it injects itself as it's own callback\r\n3:28 it sets the upload_progress and then restores the original\r\nmwillbanks\r\n3:34 alright i am going to open up an issue on GH and then i got to go home"},"comment":{"url":"https://api.github.com/repos/zendframework/zf2/issues/comments/104707723","html_url":"https://github.com/zendframework/zf2/issues/4821#issuecomment-104707723","issue_url":"https://api.github.com/repos/zendframework/zf2/issues/4821","id":104707723,"user":{"login":"mwillbanks","id":38209,"avatar_url":"https://avatars.githubusercontent.com/u/38209?v=3","gravatar_id":"","url":"https://api.github.com/users/mwillbanks","html_url":"https://github.com/mwillbanks","followers_url":"https://api.github.com/users/mwillbanks/followers","following_url":"https://api.github.com/users/mwillbanks/following{/other_user}","gists_url":"https://api.github.com/users/mwillbanks/gists{/gist_id}","starred_url":"https://api.github.com/users/mwillbanks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwillbanks/subscriptions","organizations_url":"https://api.github.com/users/mwillbanks/orgs","repos_url":"https://api.github.com/users/mwillbanks/repos","events_url":"https://api.github.com/users/mwillbanks/events{/privacy}","received_events_url":"https://api.github.com/users/mwillbanks/received_events","type":"User","site_admin":false},"created_at":"2015-05-22T16:38:18Z","updated_at":"2015-05-22T16:38:18Z","body":"@tasmaniski I'm not certain that this is a fixable problem without a huge BC break.  That's part of the reason we haven't touched it.  There are far better technologies than using the upload progress such as an html5 based uploader where you upload a packet at a time.  A great example of this are tools like: http://www.plupload.com/"}}