Of course, there is. In fact there are various libraries out there ready to be used, for example:
The SimpleLoginSecure
is very easy to use, and is the one we are going to see in this example. First download it from the Wiki, unzip it, and copy the unzipped contents to the application/libraries
folder. We need to do just one more thing in order to use the library, we need to create this table:
CREATE TABLE `users` ( `user_id` int(10) unsigned NOT NULL auto_increment, `user_email` varchar(255) NOT NULL default '', `user_pass` varchar(60) NOT NULL default '', `user_date` datetime NOT NULL default '0000-00- 00 00:00:00', `user_modified` datetime NOT NULL default '0000-00-00 00:00:00', `user_last_login` datetime NULL default NULL, PRIMARY KEY (`user_id`), UNIQUE KEY `user_email` (`user_email`) ) DEFAULT CHARSET=utf8;