How to  redirect the user to a  page and show a message on the admin overlay (using drupal_set_message and drupal_goto) I need to redirect the user to a destination and show a confirmation/error message. How can I do that? This is my code:

watchdog('webform', 'The user @user has been successfully created', array('@user'=&gt; $mail));
drupal_set_message(t('Settings saved.', array()));
drupal_goto(drupal_get_destination());


This code redirects, but the message is not shown. Do i need some special action in the destination page?

EDIT - the problem is that i'm redirecting to an administrative page and the message is showing in the main theme, i want it to display on the overlay theme. I'll  explain a little bit more in depth what i'm doing (this could be totally wrong).

I added a link that the user can click when he is viewing a submission entered through a webform (webform module). i defined a menu voice for that link in this way (i'ts only a callback, no page is shown):

$items ['createuser/%'] = array (
                                    'title' =&gt; 'Create users', 
                                    'access callback' =&gt; TRUE, 
                                    'page callback' =&gt; 'provintegra_createuser', 
                                    'page arguments' =&gt; array (
                                                            1 ), 
                                    'type' =&gt; MENU_CALLBACK );


Then i defined provintegra_createuser 

function provintegra_createuser($sid) {
        //save user
    watchdog ( 'webform', 'L\'utente @utente è stato creato cons successo', array (
                                                                                    '@utente' =&gt; $mail ) );
    drupal_set_message(t('Settings saved.', array()));
    drupal_goto(drupal_get_destination());//This redirects you to the page of the webform submission in the overlay
}


I se the message "Setting saved" but it's in the main theme, not in the theme (seven) i'm using for the administrative overlay. Do i need to set some special parameter so that the message is shown in the overlay?
I don't think this is possible with the current message system, it would require some crazy workaround do make it work anyways.

The problem is that when you use drupal_set_message(), the message is stored in the session variable and displayed whenever possible. When you redirect to a page with an overlay two things happens.


The main page is rendered and displayed.
The overlay page is rendered and displayed (with an iframe).


This means that whatever message you set, would always be displayed on the main page.

What you could do, is when the messages has been extracted to set them again and remove them. This could happen in your theme somewhere. The problem is that it is probably very hard to determine when you should do this, as you effectively would hide all messages if you always did this. Another side effect would be that you would constantly get more and more messages, possibly leading to a fatal memory error at worse.