?
Solved

using $_SESSION in mixed codeigniter enivronment

Posted on 2011-09-19
3
Medium Priority
?
717 Views
Last Modified: 2012-05-12
Hello,

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?

Thanks,
0
Comment
Question by:DanRaposo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 29

Accepted Solution

by:
fibo earned 2000 total points
ID: 36567484
Seems that yes there is a problem with CI, as shown in places such as

http://codeigniter.com/forums/viewthread/73057/#361671 (I would test the first solution of simply placing a session_start(); in all CI pages)

http://codeigniter.com/user_guide/libraries/sessions.html 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 http://codeigniter.com/wiki/Native_session/ would give you a nice solution
0
 
LVL 6

Expert Comment

by:jjperezaguinaga
ID: 36570214
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 (http://codeigniter.com/user_guide/libraries/sessions.html) and replace $_SESSION in your application.

Best regards,
-JJ
0
 

Author Comment

by:DanRaposo
ID: 36980267
Gang,

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.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There is a huge demand for CodeIgniter among the PHP web developers due to its dynamic features and benefits these days. It is one of most popular and agile open source PHP framework for creating robust web applications in PHP web development field.…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question