Eric Barnes committed d0bb0b8

Added csrf to security docs

Comments (0)

Files changed (1)


 <p>If it is acceptable for the user input to include relative paths, e.g. <kbd>file/in/some/approved/folder.txt</kbd>, you can set the second optional parameter,
 	<samp>$relative_path</samp> to TRUE.</p>
 <code>$filename = $this->security->sanitize_filename($this->input->post('filename'), TRUE);</code>
 <!-- @todo write docs for CSRF methods -->
+<h2>Cross-site request forgery (CSRF)</h2>
+<p>You can enable csrf protection by opening your <kbd>application/config/config.php</kbd> file and setting this:</p>
+<code>$config['csrf_protection'] = TRUE;</code>
+<p>If you use the <a href="../helpers/form_helper.html">form helper</a> the <var>form_open()</var> function will automatically insert a hidden csrf field in your forms.</p>
 <!-- END CONTENT -->