Welcome Guest, Not a member yet? Register   Sign In
getting error on hosted site for logout....
#1

[eluser]mahe11[/eluser]
Hi all,
when i run my site on Localhost then eroor not occur but when i launch my site on my host then following error show for Logout link


Code:
[color=brown]A PHP Error was encountered

Severity: Notice

Message: Undefined property: Logout::$session

Filename: controllers/logout.php

Line Number: 5[/color]


means that on line
Code:
$this->session->sess_destroy();
#2

[eluser]Josh Holloway[/eluser]
Are you loading the session library?

Either in your config/autoload.php set the following:

Code:
$autoload['libraries'] = array('database', 'session');

or in the controller:

Code:
$this->load->library('session');
#3

[eluser]mahe11[/eluser]
Thanks josh_holloway,
It work fine but it cant redirect to my targeted page... it still remain on parent page.

I already added in autoload.php

Code:
$autoload['libraries'] = array('database', 'session');

and as per ur suggestion add in my controller :

Code:
$this->load->library('session');
#4

[eluser]Atharva[/eluser]
[quote author="mahe11" date="1294760748"]Thanks josh_holloway,


Code:
$autoload['libraries'] = array('database', 'session');

and as per ur suggestion add in my controller :

Code:
$this->load->library('session');
[/quote]

You either need to load the library in autoload.php OR in controller, no need of loading it in both places.
#5

[eluser]Josh Holloway[/eluser]
Correct, I did put OR Wink

@Mahe11 can you copy your controller here so we can se what you're trying to achieve?
#6

[eluser]mahe11[/eluser]
@Atharva
Thanks i follow ur suggestion and remove session from autoload.php


@Josh Holloway,
Thanks i got solution.




Theme © iAndrew 2016 - Forum software by © MyBB