Welcome Guest, Not a member yet? Register   Sign In
Session Library not loading in MY_Controller... even though it should be autoloaded.
#6

[eluser]skcin7[/eluser]
Yeah, I know that. I only use flashdata for some things, like if a user deleted something, I'll set a flashdata variable to say "This item has been deleted" so that it's displayed on the next page. No need to keep it in a regular session variable if it's only needed for the next page. The "USER_ID" variable is not a flashdata variable, though. I have it set as a regular session variable so that the application can keep track of what user is logged in from page to page. It seems I'm not communicating my problem well enough.

I'm working on two web applications: a personal website, and an application for a client. I'll upload a working copy now of my personal website so you guys can see the files: http://skcin7.com/upload/nicholas-morgan.rar

Here is an example of the working 404 error: http://www.nicholas-morgan.com/welcomeblah (The 'welcomeblah' controller does not exist, but the 404 page shows up as expected)
Here is an example of the 404 page not showing up: http://www.nicholas-morgan.com/welcome/blah (The 'blah' method does not exist, but the 404 error does not show up. only the layout shows up)

In this project, the 404 content does not show up but the header/sidebar/footer do show up. In the project for the client, PHP Notice and Fatal Errors occur. The difference between my personal website and the one for the client is that the one for the client has a user login system, and checks the value of "USER_ID" session variable inside the constructor of the MY_Controller class, so it tries to access the Session Library which isn't loaded, so an error occurs. The Session Library isn't being loaded for some reason. The Session Library is normally autoloaded in my application, but for some reason it doesn't get autoloaded in this situation. I attempt to solve this by loading the library explicitly with $this->load->library('session') (even though I shouldn't have to) on the line before where the error is occurring, and the error still occurs. What the hell?!


Messages In This Thread
Session Library not loading in MY_Controller... even though it should be autoloaded. - by El Forum - 02-13-2012, 03:50 PM



Theme © iAndrew 2016 - Forum software by © MyBB