Using Drupal Session Variables outside of Drupal

Drupal stores session variables a bit differently then normal php applications, so some integration is required.

If you have an external script you want to call and need to include variables, then you need to add the following to your script:

Change anything with @@ @@

require_once './includes/';
define('DRUPAL_ROOT', getcwd());

Once you have added the necessary information your will be able to get the same session variables.

No comments:

Post a Comment