using $_SESSION in mixed codeigniter enivronment


I am working on a project that (for some reason) has mixed a codeigniter environment with a standard php environment.  Codeigniter based pages have urls to non-codeigniter pages.

I can't seem to get $_SESSION to work.  Cookies are enabled and the session_start is not called until i enter the non-codeigniter code.

Anyone aware of any issues with $_SESSION getting clobbered or disabled  by codeigniter?

Who is Participating?
Bernard S.Connect With a Mentor Commented:
Seems that yes there is a problem with CI, as shown in places such as (I would test the first solution of simply placing a session_start(); in all CI pages) indicates that CI manges its own way session data, so you might consider to build a small php that you would include at the start of each php non-CI page.
Seems that would give you a nice solution
Greetings DanRaposo,

I strongly suggest that you use the native session class CodeIgniter provides. $_SESSION has issues with CodeIgniter. There's no point of using a Framework if you are not going to take advantage of its libraries. If I were you, I would give a look to the Session User Guide ( and replace $_SESSION in your application.

Best regards,
DanRaposoAuthor Commented:

Unfortunately, we inherited a system that is a mix of CI and non-CI.  We'll just have go one way or the other to resolve this.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.