Hi,

I'm having issues with running Ajax and the security component
alongside each other.  Security works fine on the other forms.  Ajax
works fine if Security is commented out.

Security is included in the App Controller alongside other components

        'Security' => array(
            'csrfExpires' => '+2 hour'
        )

and I've added the line into AppController:BeforeFilter.

$this->Security->blackHoleCallback = '_fail';

I've tried this in the beforeFilter function of the controller but not
work:

if(isset($this->Security) && $this->action == 'tracker') {
 $this->Security->csrfCheck = false;
}

basically I have a ajax query which fails:

        function update_log() {
            //This is our ajax call.
            jQuery.ajax({
                type: 'POST',
                url: "<?php echo Configure::read('Link.site'); ?>/logs/
tracker",
                data : {"lat": latitude, "lon":longitude,
"resource":resource},
                dataType : 'json',
                success: function(data) {
                    jQuery('input#logid').val(data.log);
                }
            }); //End Visitor Code

I tried to construct a hidden form which I serialised and sent which
had the tokens but this failed too.

Please help - this needs to go live :(

Thanks

Chris

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to