Welcome Guest, Not a member yet? Register   Sign In
AJAX and jQuery
#11

[eluser]predat0r[/eluser]
Here is my code snippet:

- You set in config the CSRF prot. true, and give a name for the cookie (here: csrf_cookie)
- download and insert jquery.cookie.js
- and as you see you send the cookie info too, trough post, and won't get error at least for this.
Code:
...
                 var cct = $.cookie('csrf_cookie');
                $.ajax({
                async: false,
                type: "POST",
                url: base_url + 'admin/ajaxhelp',
                data: { id : temp, csrf_test_name : cct },
                dataType: "html",
                success: function(data) {
                                ...
#12

[eluser]Jason Tan Boon Teck[/eluser]
Thank you, predat0r.




Theme © iAndrew 2016 - Forum software by © MyBB