Check if session has started

assuncao

Member
Hi,
I created new reports that queries directly the database. I would like to use the same session, I don't want to create a new login for these pages. Unfortunatelly when I try to dump the $_SESSION variable, nothings shows up.
Could someone give a hint how can I check if the person is already logged? My report does not use any framework.
Thank you!
 
Well, while it is not advisable, what you could do, is to get an instance of the app in your custom file(s):
PHP:
define('MW_RETURN_APP_INSTANCE', true);

// define the type of application we are creating.
define('MW_APP_NAME', 'customer');

// and start an instance of it.
require_once(dirname(__FILE__) . '/../apps/init.php');

// now Yii::app() is available.
if (Yii::app()->customer->isGuest) {
   // this guy is a guest.
}
 
Well, while it is not advisable, what you could do, is to get an instance of the app in your custom file(s):
PHP:
define('MW_RETURN_APP_INSTANCE', true);

// define the type of application we are creating.
define('MW_APP_NAME', 'customer');

// and start an instance of it.
require_once(dirname(__FILE__) . '/../apps/init.php');

// now Yii::app() is available.
if (Yii::app()->customer->isGuest) {
   // this guy is a guest.
}
A-M-A-Z-I-N-G! That's exactly what I needed. Thank you again!
 
Back
Top