How to handle when Session become blank on some pages.
In this Tutorial, we are Showing solution to codeigniter developer. Some time we get irritate due to session break or session get blank on some pages during making live project on Codeigniter or website.
Developers use many short cut and uses sessions those stay only for some times. Here I am showing you how to keep session for a long time on all pages. We are showing permanent solution for storing a session in MVC module of codeigniter.
Open the file and change some content into it.
First you have to follow the path application/config/config.php $config['sess_use_database'] = FALSE; TO $config['sess_use_database'] = TRUE; and $config['sess_table_name'] = 'ci_sessions'; // sess_table_name should be "ci_sessions"
After changing this syntax just copy and paste the SQL Query into Database.
CREATE TABLE IF NOT EXISTS `ci_sessions` ( `session_id` varchar(60) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `ip_address` varchar(32) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `user_agent` varchar(60) COLLATE utf8_unicode_ci NOT NULL, `last_activity` int(20) unsigned NOT NULL DEFAULT '0', `user_data` text COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`session_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;and the just clear all the cookies and clear cache of model.
You Might Also Read : -
- How to Send Bulk Emails in java Technology.
- How to Check all Checkboxes by clicking one checkbox.
- How to Completely Disable cache for PHP project.
- How to Send data using Ajax and JavaScript into database.
- Dynamically Add Input fields into the form using JQuery.
- Magento Issues While Installing a New Installation or Theme.
- jQuery Techniques For URL, How to Get Query strings and Hashvalue Parameters.
0 comments :
Post a Comment