O'Reilly logo

CodeIgniter 2 Cookbook by Rob Foster

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using HTTPS with CodeIgniter

Using SSL is a huge topic, as is online security in general; therefore, I strongly recommend you read widely about web security (because this recipe isn't really a security primer). However, if you specifically wish to protect certain pages with an SSL certificate, there is an easy way to do it. We can create a CodeIgniter helper file to toggle SSL support on or off. Let's see how to do it.

Getting ready

I'm sure you know of the benefits of requiring certain pages in a website to be protected with an SSL certificate. The sight of that green address bar and little padlock can go a long way in allaying a user's concerns with entering data in a website. CodeIgniter doesn't come with SSL support built-in; however, it is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required