I am just getting stated with CodeIgniter and am trying to hash out my regular modules/functions and get them working properly within the mvc framework.
I have a few specific questions, if anyone has a strong background with CI:
SESSIONS
The CI session stores session data on the client side in a cookie, which just isn't going to work for me. I know there are a few replacements for it, or I could build my own library/helper, but I just don't see any benefit over just using $_SESSION.
If I just use $_SESSION, will I have any problems with the rest of the framework? Does any other part of the framework depend on using the CI session?
I feel a bit weird about stepping outside the framework for something so basic, but I am pretty comfortable with plain PHP - I am basically just looking to use CI for mvc and to enforce a more modular aspect for my projects.
CODE FLOW & CONFIG
I have a few config items that need to be done before almost anything else.
For example, say I have a constant APP_LIVE, which is set true/false based on the name of the current server. This has to happen really early, as paths, error reporting, the CI system and application folders, etc, will be set based on it.
The problem is that the system_folder and application_folder (which will be set based on which server the code is running on) are set first thing in the index file, before any of the configs have loaded.
Also, I have a functions that check for things in the url, and may redirect before the page ever loads. For example, some pages need to enfore the presence of www. in the url (for seo), track affiliates, visitor sources, marketing flags, etc.
Where is the best place to put things like this that have to happen really early? I know there is a config file, an autoload file, a constants file, etc, but those are too late for some items.
Is it a bad practice to simply put these things into the top of the main index file, or to make an include there to a global config file?
Again, I feel like I am stepping outside the framework, and wonder if I'm just doing that because I don't have a solid understanding of it yet?
LAYOUT / HEADER FOOTER
Like most people, I have a top header, navigation, footer etc.
I am used to just having them in include files, which are included into my page template. I believe I can do that the same way, by just making them views and including them into my main page view. Is that the best way to go? Some of them need a bit of data, like what page they are on for the navigation, etc. What's the best way to handle navigation, shared header/footer, etc?