Unable to locate the specified class: Session.php |
Here my logfile content:
The welcome page is in my Ajax result. libv12.js:1978 http://<server>.touchingservices.nl/inde...n=no_check jquery.min.js:4 XHR finished loading: POST "http://<server>.touchingservices.nl/index.php/?c=MY_Ezbuild_session_management&m=get_session".send @ jquery.min.js:4ajax @ jquery.min.js:4session2client @ libv12.js:1979(anonymous function) @ login.php:26 libv12.js:1490 get_page_data http://<server>.touchingservices.nl/inde...a&pageID=1 jquery.min.js:4 XHR finished loading: POST "http://<server>.touchingservices.nl/index.php/MY_Ezbuild_provider/get_page_data".send @ jquery.min.js:4ajax @ jquery.min.js:4get_page_data @ libv12.js:1492js.onload @ libv12.js:1163 libv12.js:340 Ajax setup json error <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Welcome to CodeIgniter</title> <style type="text/css"> :election { background-color: #E13300; color: white; } ::-moz-selection { background-color: #E13300; color: white; } body { background-color: #fff; margin: 40px; font: 13px/20px normal Helvetica, Arial, sans-serif; color: #4F5155; } a { color: #003399; background-color: transparent; font-weight: normal; } h1 { color: #444; background-color: transparent; border-bottom: 1px solid #D0D0D0; font-size: 19px; font-weight: normal; margin: 0 0 14px 0; padding: 14px 15px 10px 15px; } When I fire http://<server>.touchingservices.nl/inde...a&pageID=1 I got Unable to locate the specified class: Session.php John
I digged deeper and deeper. For the sake of completenes querystring parameters is set to true.
The message of Unable to locate the specified class: Session.phpUnable to locate the specified class: Session.php is coming from system/core/common.php line 187. The session class is a bit different from the others: <root>\system\libraries\Session\Session.php So it is one level deeper then the other libraries. In my autoload.php I have the following: $autoload['libraries'] = array('database', 'user_agent', 'session'); In my controllers I don't have load session calls any more. I hope some one has a clever moment and wants to share this! John
Digging deeper I put this in common.php
echo 'Unable to locate the specified class: ',APPPATH.$directory.'/'.$class.'.php or '.BASEPATH.$directory.'/'.$class.'.php'; I copied Session.php to System\libraries and got new errors A PHP Error was encountered Severity: Warning Message: ini_set(): A session is active. You cannot change the session module's ini settings at this time Filename: libraries/Session.php Line Number: 314 Backtrace: File: /home/web453/domains/touchingservices.nl/public_html/furstvdrd/application/controllers/MY_Ezbuild.php Line: 14 Function: __construct File: /home/web453/domains/touchingservices.nl/public_html/furstvdrd/application/controllers/MY_Ezbuild_dwh.php Line: 20 Function: __construct File: /home/web453/domains/touchingservices.nl/public_html/furstvdrd/application/controllers/MY_Ezbuild_provider.php Line: 51 Function: __construct File: /home/web453/domains/touchingservices.nl/public_html/furstvdrd/index.php Line: 315 Function: require_once A PHP Error was encountered Severity: Notice Message: A session had already been started - ignoring session_start() Filename: libraries/Session.php Line Number: 141 Backtrace: File: /home/web453/domains/touchingservices.nl/public_html/furstvdrd/application/controllers/MY_Ezbuild.php Line: 14 Function: __construct File: /home/web453/domains/touchingservices.nl/public_html/furstvdrd/application/controllers/MY_Ezbuild_dwh.php Line: 20 Function: __construct File: /home/web453/domains/touchingservices.nl/public_html/furstvdrd/application/controllers/MY_Ezbuild_provider.php Line: 51 Function: __construct File: /home/web453/domains/touchingservices.nl/public_html/furstvdrd/index.php Line: 315 Function: require_once Thanks for all your help.
So what I did was hacking session.php removing all the errors. I can not attach it.
Another thing I have query string turned on and the old way with / instead stopped working in 3.1. In my code I have $this->session->set_userdata("userID", $id); $this->session->set_userdata("login", "true"); echo "after login <br/>"; print_r($this->session); The new params userID and login is true are not in the $this->session object. John
The session mechanism in 3.1 is not compatible with earlier versions:
PHP Code: $newdata = array( $this->session->set_userdata($newdata); 3.1 way is fine the old way stopped working PHP Code: $this->session->set_userdata("userID", $id); So I got my system backup again but can someone check my remarks and improve CI? See attached new version of session.php. John
After login I have this:
[{"login":"true","group":"4"}]CI_Session Object ( [userdata] => Array ( [__ci_last_regenerate] => 1474525020 [language] => NL [poolID] => 1 [labelID] => 1 [id] => [userID] => 3 [login] => 1 [group] => 4 [agent] => 3 ) [_driver:protected] => files [_config:protected] => Array ( [cookie_lifetime] => 7200 [cookie_name] => ci_session [cookie_path] => / [cookie_domain] => [cookie_secure] => [expiration] => 7200 [match_ip] => [save_path] => /home/web453/domains/touchingservices.nl/public_html/x/system/furstvdrd/log ) ) so login is there after this I do a call to public function show_session() { print_r($this->session); } and there I got CI_Session Object ( [userdata] => Array ( [__ci_last_regenerate] => 1474525597 [language] => NL [poolID] => 1 [labelID] => 1 ) [_driver:protected] => files [_config:protected] => Array ( [cookie_lifetime] => 7200 [cookie_name] => ci_session [cookie_path] => / [cookie_domain] => [cookie_secure] => [expiration] => 7200 [match_ip] => [save_path] => /home/web453/domains/touchingservices.nl/public_html/x/system/furstvdrd/log ) ) So here I miss login is true. What's going on? How can I detect someone has a valid login? John |
Welcome Guest, Not a member yet? Register Sign In |