Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the CodeIgniter security-related settings

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article focuses on "what are the CodeIgniter security-related settings", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what are the CodeIgniter security-related settings"?

The CodeIgniter framework itself provides some security settings, such as protection against XSS and CSRF attacks, defense against SQL injection attacks and so on.

As far as the profile is concerned:

In application/config/config.php

$config ['encryption_key'] =''; / / this must be set to encrypt your own cookie, etc. $config ['cookie_secure'] = TRUE / / set to TRUE/* |-| Global XSS Filtering global XSS filtering is set to TRUE | -| | Determines whether the XSS filter is always active when GET | POST or | COOKIE data is encountered | * / $config ['global_xss_filtering'] = TRUE / / prevent csrf attacks $config ['csrf_protection'] = TRUE;$config [' csrf_token_name'] = 'mall_tooken';$config [' csrf_cookie_name'] = 'mall_cookie';$config [' csrf_expire'] = 7200 / set the appropriate time

Open system/core/Input.php

Set the $xss_clean in the get and post methods to true. Of course, if your site is secure, don't set it or explicitly set it when you call get or post to get the parameters.

You need to pay attention to:

1. Use

$this- > input- > get ('name', true)

Instead of using $_ GET ['name']

two。 Use

$this- > input- > post ('name', true)

Instead of using $_ POST ['name']

3. Use ActiveRecord query statements instead of statements such as select

At this point, I believe you have a deeper understanding of "what are the CodeIgniter security-related settings"? you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report