Results 1 to 3 of 3

Thread: CSRF Protection (CodeIgniter + EXTJS 5) - How To?

  1. #1
    Sencha User Carlos Souza's Avatar
    Join Date
    May 2015
    Location
    Minas Gerais, Brazil.
    Posts
    29
    Answers
    1

    Default CSRF Protection (CodeIgniter + EXTJS 5) - How To?

    Hello everyone.

    I'm trying to integrate EXTJS 5 and CodeIgniter 3.0. However, I can not protect my application against CSRF (Cross-Site Request Forgery). This is due to the generation of a dynamic token by PHP, which must be embedded in each form. I have ideas of how to embed this token in the form using EXTJS 5. I think every EXTJS form should be generated by PHP and then echoed to the user.
    Someone managed to integrate EXTJS with CodeIgniter? Is there any material about the subject? Can you give me an example?

    Thank you in advance and sorry for my english ...

  2. #2
    Sencha Premium Member
    Join Date
    Dec 2012
    Location
    Seattle, WA
    Posts
    423
    Answers
    34

    Default

    Why not just have the token in a hidden field in the form when its submitted?

  3. #3
    Sencha User Carlos Souza's Avatar
    Join Date
    May 2015
    Location
    Minas Gerais, Brazil.
    Posts
    29
    Answers
    1

    Default

    I found a solution: store the token in a localStorage and send it in each ajax request ... there is no need to create a hidden field.

Similar Threads

  1. extjs rest and csrf
    By pedwards in forum Ext 5: Q&A
    Replies: 1
    Last Post: 1 Oct 2014, 10:52 AM
  2. Django 1.3 Login with ExtJS 4 and CSRF
    By aldolmx in forum Ext: Discussion
    Replies: 4
    Last Post: 26 Aug 2013, 12:34 AM
  3. Extjs 4 + Codeigniter
    By hariardi in forum Ext: Discussion
    Replies: 25
    Last Post: 15 Apr 2013, 10:12 AM
  4. Extjs 4 + codeigniter 2.1
    By sebas2515 in forum Ext: Q&A
    Replies: 1
    Last Post: 30 Dec 2011, 8:11 AM
  5. How to insert csrf token into extjs form?
    By da_sweetp in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 30 Mar 2011, 3:26 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •