Welcome Guest, Not a member yet? Register   Sign In
How to use CI instance outside application?
#5

[eluser]cahva[/eluser]
If this "iBrowser" is like the imagemanager, then you could just do "oldschool" query to your ci-sessions table. For example I have this in imagemanager plugin(index.php):

Code:
<?php
session_start();

if (!isset($_COOKIE['ci_session']))
{
    die();
}

$ses = unserialize($_COOKIE['ci_session']);

mysql_connect("server", "mysql_user", "mysql_pass");
mysql_select_db('database');

$sql = "SELECT user_data FROM ci_sessions WHERE session_id = '".$ses['session_id']."'";
$result = mysql_query($sql);

if(mysql_num_rows($result) == 0)
{
    die();
}

$_SESSION['logged_in'] = true;

...

I have set in the imagemanger's config:
Code:
$mcImageManagerConfig['SessionAuthenticator.logged_in_key'] = "logged_in";

So it looks for native session 'logged_in'.


Messages In This Thread
How to use CI instance outside application? - by El Forum - 08-13-2010, 05:04 AM
How to use CI instance outside application? - by El Forum - 08-13-2010, 05:18 AM
How to use CI instance outside application? - by El Forum - 08-13-2010, 05:39 AM
How to use CI instance outside application? - by El Forum - 08-13-2010, 05:45 AM
How to use CI instance outside application? - by El Forum - 08-13-2010, 06:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB