In today’s hour long video tutorial, we’ll be doing a lot! We’ll implement a login and signup form that will allow us to lock down certain sections of our fictional site. As you’ll find, working with sessions in CodeIgniter is a cinch!
Catch Up
- Day 1: Getting Started With the Framework
- Day 2: Database Selecting Methods
- Day 3: Sending Emails
- Day 4: Newsletter Signup
- Day 5: CRUD
Day 6: Sessions
More Viewing Options


P.S. The Logout Button
I forgot to add the “logout” button during the screencast. There was so much to cover, that I was bound to forget something! Luckily, it’s really easy. Simply add a link, to the “members” area, which links to the login class, and a “logout” method (login/logout). Then, all we must do is destroy the user’s session, and redirect them back to the login form. Download the source code if confused.
function logout()
{
$this->session->sess_destroy();
$this->index();
}
Hope you Enjoy it!
Keep in mind that we’re just scratching the surface, in terms of flexibility and security. We can – and very well may – take things much further. But this should get you started!
Thank you, Screencast.com!
- Follow us on Twitter, or subscribe to the Nettuts+ RSS Feed for more daily web development tuts and articles.
- leo
- http://www.radumicu.info radum
- http://marlonansale.wordpress.com marlon ansale
- CIBeginner
- zahid
- Marcus
- http://www.phpforfun.com/ Matt
- Robo
- Sven
- http://ever-flow.net veritascs
- Attila
- Derek
- http://develop21.com Chris
- CJ
- CJ
- Sanjay Maurya
- mash
- http://johnmeher.com John Meher
- Andrew Kimball
- Andrew Kimball
- helena
- helena
- Marcelo
- labidi
- Matteo
- Matteo
- henry
- Flex
- http://rartdesign.it RArtDesign
- http://www.lollypop.gr GeorgeD
- http://rartdesign.it Sebastian
- http://rartdesign.it RArtDesign
- Ciprian
- http://midknightdesigns.com David
- Rez
- nycpicasso
- Jmorris
- Rahul Patil
- Ryan
- David
- Siddharth Sakhadeo
- http://www.darknessfalls.org.uk Ged
- http://devrabbit.com Michael Calkins
- spider
- Daniel
- http://www.darknessfalls.org.uk Ged
- Andrew
- http://www.facebook.com/sergiodk5 Asterios Patsikas
- http://www.facebook.com/sergiodk5 Asterios Patsikas
- http://www.facebook.com/profile.php?id=517826655 Lina Fayez
- hassan
- Master Yoda
- Rajith Wijepura
- hassan
- Rajith Wijepura
- http://none Jay
- telsy
- Nikki
- http://www.unionics.com Sashikanta
- Roy
- Marishka
- Shiva
- Mark
- http://www.facebook.com/dynamdilshan Dilshan Gunasekara
- hendra
- murum
- http://twitter.com/chilionsnoek Chilion Snoek
- Cristi
- abixalmon
- Sanjay Maurya
- Sanjay Maurya
- zul
- http://www.facebook.com/Sagar.S.Shinde Sagar Subhash Shinde


