Can I use codeigniter session cookie data for authentication?

I have a CodeIgniter install, which I use for most of the site. I have a /blog folder, in which I have a WordPress install.

Goal: pages inside the /blog will look have the same header as the rest of the site. They’ll also have all the features of WordPress.

Read More

For pages inside the /blog folder (running WordPress), I’m loading the CodeIgniter header view via a file_get_contents() call, since I don’t have access to the CI framework from within WordPress. I prefer not to create another copy of the header view within the WordPress template, because I’d like to maintain just one file.

Now here’s the problem: I can’t maintain the user’s state in WordPress, because I don’t have access to CodeIgniter’s session.

Since the call to the header is done via file_get_contents(), the server doesn’t have access to the same session as the client (since it is in effect a call from the server).

Is there a way I can transfer the session cookie data into CodeIgniter via the URL? Something like:

file_get_contents('http://mydomain.com/header.php?data=SESSIONDATA'). 

Am I even thinking about this the right way? Note that we are obviously on the same domain, just a different folder.

Related posts

Leave a Reply

1 comment