Unable to locate the specified class: Session.php in Codeigniter 3
The browser:
Show Error Message :
Unable to locate the specified class: Session.php
But in other Controllers working fine.
I did move site from Codeigniter 2.x to 3.x.
After that this error occurred.
When I print my session with this $this->session->all_userdata()
code the output showing session data.
What I do for resolve this error.
php codeigniter session
|
show 1 more comment
The browser:
Show Error Message :
Unable to locate the specified class: Session.php
But in other Controllers working fine.
I did move site from Codeigniter 2.x to 3.x.
After that this error occurred.
When I print my session with this $this->session->all_userdata()
code the output showing session data.
What I do for resolve this error.
php codeigniter session
add your controller code so we can have a look.
– Kevin
Nov 10 '17 at 8:06
@Kevin I found error i.e. I have called another controller likerequire('****.php')
. the session library called two times in same file.
– Varinder
Nov 10 '17 at 8:15
You can set in the autoload.php $autoload['libraries'] = array('database', 'session');
– Anand Pandey
Nov 10 '17 at 8:19
Where is this error show? Means in controller or model?
– Anand Pandey
Nov 10 '17 at 8:22
@AnandPandey error showing in controller. I am trying to use another controller's method in main controller. That's why I added controller1.php file in controller2.php.
– Varinder
Nov 10 '17 at 8:27
|
show 1 more comment
The browser:
Show Error Message :
Unable to locate the specified class: Session.php
But in other Controllers working fine.
I did move site from Codeigniter 2.x to 3.x.
After that this error occurred.
When I print my session with this $this->session->all_userdata()
code the output showing session data.
What I do for resolve this error.
php codeigniter session
The browser:
Show Error Message :
Unable to locate the specified class: Session.php
But in other Controllers working fine.
I did move site from Codeigniter 2.x to 3.x.
After that this error occurred.
When I print my session with this $this->session->all_userdata()
code the output showing session data.
What I do for resolve this error.
php codeigniter session
php codeigniter session
edited Nov 10 '17 at 8:12
NikuNj Rathod
1,28711120
1,28711120
asked Nov 10 '17 at 7:33
VarinderVarinder
102212
102212
add your controller code so we can have a look.
– Kevin
Nov 10 '17 at 8:06
@Kevin I found error i.e. I have called another controller likerequire('****.php')
. the session library called two times in same file.
– Varinder
Nov 10 '17 at 8:15
You can set in the autoload.php $autoload['libraries'] = array('database', 'session');
– Anand Pandey
Nov 10 '17 at 8:19
Where is this error show? Means in controller or model?
– Anand Pandey
Nov 10 '17 at 8:22
@AnandPandey error showing in controller. I am trying to use another controller's method in main controller. That's why I added controller1.php file in controller2.php.
– Varinder
Nov 10 '17 at 8:27
|
show 1 more comment
add your controller code so we can have a look.
– Kevin
Nov 10 '17 at 8:06
@Kevin I found error i.e. I have called another controller likerequire('****.php')
. the session library called two times in same file.
– Varinder
Nov 10 '17 at 8:15
You can set in the autoload.php $autoload['libraries'] = array('database', 'session');
– Anand Pandey
Nov 10 '17 at 8:19
Where is this error show? Means in controller or model?
– Anand Pandey
Nov 10 '17 at 8:22
@AnandPandey error showing in controller. I am trying to use another controller's method in main controller. That's why I added controller1.php file in controller2.php.
– Varinder
Nov 10 '17 at 8:27
add your controller code so we can have a look.
– Kevin
Nov 10 '17 at 8:06
add your controller code so we can have a look.
– Kevin
Nov 10 '17 at 8:06
@Kevin I found error i.e. I have called another controller like
require('****.php')
. the session library called two times in same file.– Varinder
Nov 10 '17 at 8:15
@Kevin I found error i.e. I have called another controller like
require('****.php')
. the session library called two times in same file.– Varinder
Nov 10 '17 at 8:15
You can set in the autoload.php $autoload['libraries'] = array('database', 'session');
– Anand Pandey
Nov 10 '17 at 8:19
You can set in the autoload.php $autoload['libraries'] = array('database', 'session');
– Anand Pandey
Nov 10 '17 at 8:19
Where is this error show? Means in controller or model?
– Anand Pandey
Nov 10 '17 at 8:22
Where is this error show? Means in controller or model?
– Anand Pandey
Nov 10 '17 at 8:22
@AnandPandey error showing in controller. I am trying to use another controller's method in main controller. That's why I added controller1.php file in controller2.php.
– Varinder
Nov 10 '17 at 8:27
@AnandPandey error showing in controller. I am trying to use another controller's method in main controller. That's why I added controller1.php file in controller2.php.
– Varinder
Nov 10 '17 at 8:27
|
show 1 more comment
2 Answers
2
active
oldest
votes
Add changes in application/config/autoload.php file
$autoload['libraries'] = array('database', 'session');
and in config
$config['encryption_key'] = 'pqrstuxyz';
add your controller code so we can have a look.
– Faridul Khan
Nov 11 '17 at 7:29
add a comment |
If you use Codeigniter Modular Extensions HMVC this error can occur if you forget to change your class to extend MX_Controller instead of CI_Controller
Simply Change your extended Class as following
Class YourController extends CI_Controller
to
Class YourController extends MX_Controller
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47217769%2funable-to-locate-the-specified-class-session-php-in-codeigniter-3%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Add changes in application/config/autoload.php file
$autoload['libraries'] = array('database', 'session');
and in config
$config['encryption_key'] = 'pqrstuxyz';
add your controller code so we can have a look.
– Faridul Khan
Nov 11 '17 at 7:29
add a comment |
Add changes in application/config/autoload.php file
$autoload['libraries'] = array('database', 'session');
and in config
$config['encryption_key'] = 'pqrstuxyz';
add your controller code so we can have a look.
– Faridul Khan
Nov 11 '17 at 7:29
add a comment |
Add changes in application/config/autoload.php file
$autoload['libraries'] = array('database', 'session');
and in config
$config['encryption_key'] = 'pqrstuxyz';
Add changes in application/config/autoload.php file
$autoload['libraries'] = array('database', 'session');
and in config
$config['encryption_key'] = 'pqrstuxyz';
answered Nov 11 '17 at 7:28
Faridul KhanFaridul Khan
194116
194116
add your controller code so we can have a look.
– Faridul Khan
Nov 11 '17 at 7:29
add a comment |
add your controller code so we can have a look.
– Faridul Khan
Nov 11 '17 at 7:29
add your controller code so we can have a look.
– Faridul Khan
Nov 11 '17 at 7:29
add your controller code so we can have a look.
– Faridul Khan
Nov 11 '17 at 7:29
add a comment |
If you use Codeigniter Modular Extensions HMVC this error can occur if you forget to change your class to extend MX_Controller instead of CI_Controller
Simply Change your extended Class as following
Class YourController extends CI_Controller
to
Class YourController extends MX_Controller
add a comment |
If you use Codeigniter Modular Extensions HMVC this error can occur if you forget to change your class to extend MX_Controller instead of CI_Controller
Simply Change your extended Class as following
Class YourController extends CI_Controller
to
Class YourController extends MX_Controller
add a comment |
If you use Codeigniter Modular Extensions HMVC this error can occur if you forget to change your class to extend MX_Controller instead of CI_Controller
Simply Change your extended Class as following
Class YourController extends CI_Controller
to
Class YourController extends MX_Controller
If you use Codeigniter Modular Extensions HMVC this error can occur if you forget to change your class to extend MX_Controller instead of CI_Controller
Simply Change your extended Class as following
Class YourController extends CI_Controller
to
Class YourController extends MX_Controller
answered Nov 14 '18 at 11:22
Matee GojraMatee Gojra
497412
497412
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47217769%2funable-to-locate-the-specified-class-session-php-in-codeigniter-3%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
add your controller code so we can have a look.
– Kevin
Nov 10 '17 at 8:06
@Kevin I found error i.e. I have called another controller like
require('****.php')
. the session library called two times in same file.– Varinder
Nov 10 '17 at 8:15
You can set in the autoload.php $autoload['libraries'] = array('database', 'session');
– Anand Pandey
Nov 10 '17 at 8:19
Where is this error show? Means in controller or model?
– Anand Pandey
Nov 10 '17 at 8:22
@AnandPandey error showing in controller. I am trying to use another controller's method in main controller. That's why I added controller1.php file in controller2.php.
– Varinder
Nov 10 '17 at 8:27