I’m trying the above code to set a message and redirect to a different location like this
and i’m redirecting from
example.com/somewere/index.php
to
example.com
My problem is when i get to example.com drupal doesen’t keep the session,
and the message is not shown.
Any idea will be much appreciated.
chdir('../');
require_once './includes/bootstrap.inc';
require_once './includes/common.inc';
require_once './includes/module.inc';
$url = "http://".$_SERVER['SERVER_NAME'];
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
drupal_set_message(t('Your message has been sent'), 'status', TRUE);
drupal_goto($url);
i’m taking a form and some other elements of the page and putting it outside drupal in a bootstrap that has session enable.
in
example.com/somewere/
my message is there
but on example.com/
i dont get the message
the server open me a diffrent session
can it be because i use a diffrent htaccess file in example.com/somewere/
i know messages are session based
is there a way to bypass the problem because there on the same domain and same drupal just different access position ?
I would run
session_get_cookie_paramsto see whether the path is just/. It might be that PHP sets the path to/somewherefor the session cookie and so the Drupal install in your install doesnt have a session cookie after that.