php's framework codeigniter

2019-09-02 10:50发布

问题:

i have a some problem in codeigniter session, when a page load..session value unset during page loading ..means some session variable unset( means null)...session variable before page load..

Array ( [session_id] => 2de4cec5bf6cdf3ccc5b02844a4b572a 
        [ip_address] => 127.0.0.1 
        [user_agent] => Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/2010010 
        [last_activity] => 1320479523 
        [logoff_city] => Agra 
        [user_deal_point] => 460 
        [userid] => 2 
        [email] => test@dummyid.com 
        [asfsadf] => 
        [userId] => 
        [city_name] => Agra 
        [city_id] => 1 
        [deal_id] => KGrNM03 
        [amount] => 449 
        [total_amount] => 449 
        [UserName] => 
        [UserEmail] => 
        [Mobile] => ) 

After page loading show session variable

Array ( [session_id] => 2de4cec5bf6cdf3ccc5b02844a4b572a 
        [ip_address] => 127.0.0.1 
        [user_agent] => Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/2010010 
        [last_activity] => 1320479523 
        [logoff_city] => Agra 
        [user_deal_point] => 
        [userid] => 2 
        [email] => test@dummyid 
        [asfsadf] => 
        [userId] => 
        [city_name] => Agra 
        [city_id] => 1 
        [UserName] => 
        [UserEmail] => 
        [Mobile] => ) 

回答1:

Have you upgraded from a 1.7 version of CodeIgniter to a 2.0 version? And are you storing sessions in a database table? And are you using IE? If so, I had this same problem. It was fixed when I edited the session table, user_agent field to a varchar(255). It's an issue with IE.



回答2:

See this for the answer for this problem : Losing a session variable between one page with codeigniter session library

To sum up, you had missing resource(s) file.

Good luck!