CodeIgniter Forums
Access CodeIgniter session outside of CI - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Access CodeIgniter session outside of CI (/showthread.php?tid=21214)



Access CodeIgniter session outside of CI - El Forum - 08-03-2009

[eluser]renownedmedia[/eluser]
I'm wondering if anyone has built this functionality before I go ahead and set it up myself...

Basically I'm looking for something along the lines of this:

Code:
require_once("ci_sessions.php");
$cs = new ci_session();
echo $cs->userdata('user_id');

What I need to do is access data stored in the CI Session of the user viewing the website. But, I'd need to get the data from a page outside of CI, lets just use an example of a third party forum script. Normally, I'd use $_SESSION and access that from a varying set of scripts during one user session.


Access CodeIgniter session outside of CI - El Forum - 08-04-2009

[eluser]renownedmedia[/eluser]
Bump!

How the process would work is our included file would open CI's config.php, get the cookie details, if using a database it would open teh database.php config file, and build a wrapper class to access the database in a similar syntax offered by CI's $this->session->blah_blah_blah()

I'm sure someone has built this!


Access CodeIgniter session outside of CI - El Forum - 12-18-2009

[eluser]Ollie Rattue[/eluser]
Did you ever code this? I need to do the exact same thing, to pull some session data into wordpress.


Access CodeIgniter session outside of CI - El Forum - 03-23-2010

[eluser]valajbeg[/eluser]
need it too : ( ??? anyone ???


Access CodeIgniter session outside of CI - El Forum - 03-24-2010

[eluser]Phil Sturgeon[/eluser]
Take a look at system/libraries/Session.php and rip code out of sess_read().


Access CodeIgniter session outside of CI - El Forum - 08-29-2012

[eluser]jamesduncan[/eluser]
Did anyone ever get this to work?

As to the comment of ripping out the code from the session - it seems to be all code igniter code - how would I implement this into a wordpress install?

Thanks


Access CodeIgniter session outside of CI - El Forum - 08-29-2012

[eluser]Phil Sturgeon[/eluser]
The encoded session is encoded with a certain algorithm, and a certain salt. If it's calling another method, then go and look at that method.

Just do whatever CodeIgniter is doing, and do that. Then you can read your session.


Access CodeIgniter session outside of CI - El Forum - 01-24-2013

[eluser]Unknown[/eluser]
I've encountered similar problem, and this topic motivated me to create — CoreIgniter.
It can grab sessions in a native manner, wherever they a stored cookie or database, encrypted or not.
Not only sessions are available, though I didn't tested it much. But sooner I will.