[fw-general] Re: Session Db trouble with ajax request without event handleri
It works with a table like CREATE TABLE `tn_session` ( `id` char(32), `modified` int, `lifetime` int, `data` text, PRIMARY KEY (`id`) )ENGINE=InnoDB DEFAULT CHARSET=utf8; and in the bootstrap protected function _initDbSession() { $config = array( 'name' = 'tn_session', 'primary'= 'id', 'modifiedColumn' = 'modified', 'dataColumn' = 'data', 'lifetimeColumn' = 'lifetime' ); Zend_Session::setSaveHandler(new Zend_Session_SaveHandler_DbTable($config)); } Bye. -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Session-Db-trouble-with-ajax-request-tp2073591p2075594.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Re: Session Db trouble with ajax request without event handleri
Are your sessions not working at all, or do they only break when on XHR requests? -- Hector On Thu, Apr 29, 2010 at 7:39 AM, whisher whis...@mp4.it wrote: It works with a table like CREATE TABLE `tn_session` ( `id` char(32), `modified` int, `lifetime` int, `data` text, PRIMARY KEY (`id`) )ENGINE=InnoDB DEFAULT CHARSET=utf8; and in the bootstrap protected function _initDbSession() { $config = array( 'name' = 'tn_session', 'primary'= 'id', 'modifiedColumn' = 'modified', 'dataColumn' = 'data', 'lifetimeColumn' = 'lifetime' ); Zend_Session::setSaveHandler(new Zend_Session_SaveHandler_DbTable($config)); } Bye. -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Session-Db-trouble-with-ajax-request-tp2073591p2075594.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Re: Session Db trouble with ajax request without event handleri
I don't understand. There's nothing special about an XHR request that would kill the session. In fact, I use XHR all the time with various session backends and have never had a problem that resulted from XHR alone. There must be something else going on, perhaps in your controller or custom plugins that would cause the session to be destroyed. -- Hector On Thu, Apr 29, 2010 at 12:02 PM, whisher whis...@mp4.it wrote: They only break when on XHR requests. -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Session-Db-trouble-with-ajax-request-tp2073591p2076049.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Re: Session Db trouble with ajax request without event handleri
Yes, I agree with you but the script works fine with session in file so I'm at my wits end :( Thanks just a lot for your help. -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Session-Db-trouble-with-ajax-request-tp2073591p2076218.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Re: Session Db trouble with ajax request without event handleri
A couple of things I would test to see what might be going on: 1) Verify that the session has been started using Zend_Session::start() 2) Verify that the session id is consistent between XHR and non-XHR requests using Zend_Session::getId() 3) Verify that the session data is being written to the database with the right session id. -- Hector On Thu, Apr 29, 2010 at 2:20 PM, whisher whis...@mp4.it wrote: Yes, I agree with you but the script works fine with session in file so I'm at my wits end :( Thanks just a lot for your help. -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Session-Db-trouble-with-ajax-request-tp2073591p2076218.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Re: Session Db trouble with ajax request without event handleri
Do you use firebug for debugging ajax requests? On Fri, Apr 30, 2010 at 12:24 AM, Hector Virgen djvir...@gmail.com wrote: A couple of things I would test to see what might be going on: 1) Verify that the session has been started using Zend_Session::start() 2) Verify that the session id is consistent between XHR and non-XHR requests using Zend_Session::getId() 3) Verify that the session data is being written to the database with the right session id. -- Hector On Thu, Apr 29, 2010 at 2:20 PM, whisher whis...@mp4.it wrote: Yes, I agree with you but the script works fine with session in file so I'm at my wits end :( Thanks just a lot for your help. -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Session-Db-trouble-with-ajax-request-tp2073591p2076218.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Re: Session Db trouble with ajax request without event handleri
Yes, I'm using Jquery. Like tvnVideoApp.sendRequest = function(page) { $.ajax({ type: POST, timeout:3000, url: sBasePath + '/admin/video/listxhr' , cache: false, dataType: 'html', data: {'page':page} , success: function(data){ $(#dataWrapper tbody).html(data); alert(data); }, error:function(xhr, str, er){ alert('error'); return; } }); } Thanks for the quick reply :) -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Session-Db-trouble-with-ajax-request-tp2073591p2073605.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Re: Session Db trouble with ajax request without event handleri
That seems fine to me. So if you change the session storage from Db to File, it works? Are any other settings changed? -- Hector On Wed, Apr 28, 2010 at 10:00 AM, whisher whis...@mp4.it wrote: Yes, I'm using Jquery. Like tvnVideoApp.sendRequest = function(page) { $.ajax({ type: POST, timeout:3000, url: sBasePath + '/admin/video/listxhr' , cache: false, dataType: 'html', data: {'page':page} , success: function(data){ $(#dataWrapper tbody).html(data); alert(data); }, error:function(xhr, str, er){ alert('error'); return; } }); } Thanks for the quick reply :) -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Session-Db-trouble-with-ajax-request-tp2073591p2073605.html Sent from the Zend Framework mailing list archive at Nabble.com.