Welcome Guest, Not a member yet? Register   Sign In
Undefined property: CI_Loader::$session
#1

A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_Loader::$session
Filename: views/add_newsletter.php
Line Number: 75


views/add_newsletter.php

PHP Code:
<form action="<?php echo base_url();?>cpages/send" class="validate" method="POST" class="form bg-clouds padding-top20 padding-bottom20 validate">
                                <?
php //echo $msg.' '.$session;?>
                    
                                <input type="hidden" name="token" value="<?php echo $token;?>">
                                <input type="hidden" name="back" value="<?php echo $this->uri->segment(3);?>">
                    
                                <div class="row">
                                    <input type="text" name="name" class="required" placeholder="Name" />
                                </div>
                    
                                <div class="row">
                                    <input type="text" name="email" class="required email" placeholder="E-mail" />
                                </div>
                    
                                <div class="row">
                                    <input type="text" name="phone" class="required" placeholder="Phone" />
                                </div>
                    
                                <div class="row">
                                    <textarea name="message" class="required" placeholder="Message"></textarea>
                                </div>
                    
                                <div class="row">
                                    <button type="submit" value="Send Message">Send</button>
                                </div>
                    
                                <div class="clearfix"></div>
                    
                                <div class="row">
                                    <h4 align="center"><?php echo $this->session->flashdata('warning');?></h4>
                                </div>
                    
                        </form> 


Line 74 - 75:  <div class="clearfix"></div>

How to fix this error:   Undefined property: CI_Loader::$session ?
" If I looks more intelligence please increase my reputation."
Reply
#2

Why don't you take the time to learn PHP and quit asking the same question over and over?
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

I think this is more than php it's CI that's I am still learning. I am still learning it for 5 months. Still new. That's why I think why I need this forum.
" If I looks more intelligence please increase my reputation."
Reply
#4

I already add this to the constructor: $this->load->library('session');

and now I am having this error:

--------------------------------------


A PHP Error was encountered

Severity: Warning

Message: mkdir(): Invalid path

Filename: drivers/Session_files_driver.php

Line Number: 117

Backtrace:

File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\application\controllers\cpages.php
Line: 34
Function: library

File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\index.php
Line: 315
Function: require_once
An uncaught Exception was encountered

Type: Exception

Message: Session: Configured save path '' is not a directory, doesn't exist or cannot be created.

Filename: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\system\libraries\Session\drivers\Session_files_driver.php

Line Number: 119

Backtrace:

File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\application\controllers\cpages.php
Line: 34
Function: library

File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\index.php
Line: 315
Function: require_once

--------------------------------------------

How to fix the errors?

Line 116 - 117: $paths = $CI->load->get_package_paths(TRUE);

Line 119: $class_name = $prefix.$child_name;
" If I looks more intelligence please increase my reputation."
Reply
#5

It sounds like you haven't configured your sessions storage location properly.
Reply
#6

How to configure sessions storage location properly?

I am looking for where to start but do not know how to?

From which file? And how?
" If I looks more intelligence please increase my reputation."
Reply
#7

It's in the user guide, on the sessions library page.
Reply
#8

(05-28-2016, 07:21 AM)davy_yg Wrote: How to configure sessions storage location properly?

I am looking for where to start but do not know how to?

From which file?  And how?

Inside 'config' folder, files path is application/config/config.php. Using your editor find 'Session Variables' and you will see the configuration field for session. Read the comment for more guide.
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = APPPATH.'storage'; // im create folder called 'storage' inside 'application' folder.
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
Keep calm.
Reply
#9

@davy_yg

What you are doing is not learning. You just need to get the job done. This approach prevents you to remember things, to get experienced. You claim that you are learning CodeIgniter for 5 months. This is a lot of time, but you don't show progress in dealing with CI.

If you face a problem, first try to break it alone, even it would slow down your concrete goal. Try to seek information alone, I assure you, there is information in Internet for every possible problem that you might face. Try to be autonomous as much as you can, then you will make real progress. No bad feelings, Ivan.
Reply
#10

(This post was last modified: 05-28-2016, 07:43 PM by davy_yg.)

Hello,

I have been trying to figure this things out through google and have not find the answer.

I still having this same errors even after configuring this:

config/config.php

PHP Code:
$config['sess_driver'] = 'files';
 
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = APPPATH.'storage'// im create folder called 'storage' inside 'application' folder.
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE





A PHP Error was encountered
Severity: Warning
Message: mkdir(): Invalid path
Filename: drivers/Session_files_driver.php
Line Number: 117

Backtrace:

File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\application\controllers\cpages.php
Line: 34
Function: library

File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\index.phpLine: 315
Function: require_once

An uncaught Exception was encountered
Type: Exception
Message: Session: Configured save path '' is not a directory, doesn't exist or cannot be created.
Filename: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\system\libraries\Session\drivers\Session_files_driver.php
Line Number: 119

Backtrace:

File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\application\controllers\cpages.php
Line: 34
Function: library

File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\index.php
Line: 315
Function: require_once


----------------------------------

How to fix the error?

(I've known php for 3 years - CI for 5 months only)
" If I looks more intelligence please increase my reputation."
Reply




Theme © iAndrew 2016 - Forum software by © MyBB