CSRF giving problem with ajax |
I found a great way to handle this (stole from laravel) is to have the page render and have the csrf token in a meta tag. Your javascript can pull from the meta tag and if you're using something like Axios you can have the csrf injected automatically in every request. I found it's much cleaner.
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
|
Messages In This Thread |
CSRF giving problem with ajax - by tancredolt - 05-02-2015, 09:52 PM
RE: CSRF giving problem with ajax - by prabhakar - 05-03-2015, 06:25 AM
RE: CSRF giving problem with ajax - by PaulD - 05-04-2015, 09:06 AM
RE: CSRF giving problem with ajax - by matbeard - 05-06-2015, 07:20 AM
RE: CSRF giving problem with ajax - by josetrindade - 05-29-2015, 04:27 AM
RE: CSRF giving problem with ajax - by tancredolt - 05-29-2015, 12:45 AM
RE: CSRF giving problem with ajax - by techbat - 05-29-2015, 05:56 AM
RE: CSRF giving problem with ajax - by ebizzinfotech - 06-03-2019, 10:45 PM
RE: CSRF giving problem with ajax - by kintech - 09-30-2019, 05:16 AM
RE: CSRF giving problem with ajax - by albertleao - 09-30-2019, 08:36 AM
RE: CSRF giving problem with ajax - by deorwineinfotech - 03-02-2020, 11:47 PM
|