Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6895937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:58:20+00:00 2026-05-27T06:58:20+00:00

A quick intro to CodeIgniter 2 CSRF protection I know this might sound dumb,

  • 0

A quick intro to CodeIgniter 2 CSRF protection

I know this might sound dumb, but I’m wondering if this protection alters the value of the hidden input when you try to recover it by post.

Here’s a quick example to show you what the protection does.

If I write :

<input type='hidden' name='1_Info".$kid_nb."' value='".$code."'>

It will output on the page :

<input type="hidden" value="0d3a7bb9f93f438dda1f605d2ac2cb7c" name="csrf_test_name">

Protection is good. But am I going to recover the right data when I use POST method on that input? Moreover, the value of $code is CodeIgniter-encoded ( using their library ). Is it going to mess it up ?

Finally, can I still reach that input, considering his name has been changed ? I know this might sound dumb, since a good protection wouldn’t stop me from using my data, but it’s always better to ask, right ?

Thanks, as usual. I’m merely a student.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:58:21+00:00Added an answer on May 27, 2026 at 6:58 am

    I think there’s some confusion. Codeigniter does NOT overwrite your variables: hidden or not. If you enable CSRF protection, framework will ADD another hidden field and check that token on submission. You still have your variables in the form and can process them the same way you normally would.

    I don’t see how

    <input type='hidden' name='1_Info".$kid_nb."' value='".$code."'>
    

    gets converted into

    <input type="hidden" value="0d3a7bb9f93f438dda1f605d2ac2cb7c" name="csrf_test_name">
    

    The latter would just get added to your list of form fields

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

quick question I know in wordpress you can get post_content,etc but let say I
Quick one; I know a solution, but I'm looking for something more elegant if
I want to do some quick inserts but avoid duplicates into a Table. For
Quick one, but thought I'd ask. Is there a better way of getting the
I get this error very quick when I log into Typo3 4.1.3. After 5
This is probably going to sound backwards. I need for a form to submit
I know the title isn't the most descriptive, but I can't think of a
Quick Intro: We have a flash tetris game finished and we are looking to
A two-parter with a quick intro. Intro: I'm coming to Ruby from Perl, and
Found this code that breaks out CSV fields if contains double-quotes But I don't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.