Welcome Guest, Not a member yet? Register   Sign In
Access CodeIgniter session outside of CI
#1

[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.
#2

[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!
#3

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

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

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

[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
#7

[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.
#8

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




Theme © iAndrew 2016 - Forum software by © MyBB