Created
June 16, 2019 11:53
-
-
Save yuceltoluyag/dcf5eadd7ed7602372f0ede1219284e7 to your computer and use it in GitHub Desktop.
AJAX + CSRF Protection in Codeigniter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AJAX işlemlerinde CSRF hatası almamanız için HTML temanızda Footer nerede ise </body> öncesine aşağdaki kodu yapıştırın: | |
<script type="text/javascript"> | |
$.ajaxSetup({ | |
data: { | |
'<?php echo $this->security->get_csrf_token_name(); ?>': '<?php echo $this->security->get_csrf_hash(); ?>' | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment