Hi guys!
i try to make a snippet (named "autorisation"), which add (or not) special content on a page if user is login via the managerLogin snippet and belong to a specific user group (or not) .
So if you’re logged as an manager user you can see more content, depends on which group you belong to.
the snippet work fine...but not the first time.
I explain.
I’m not login -> extra content don’t appear. And that’s what i want!
login via managerLogin -> manager Login snippet show the logged template. Yes I’m login, but no extra content appear

press F5 -> my extra content appear, at last.
same thing when i want to logout.
logout via managerLogin -> extra content still appear.
refresh the page (F5) -> extra content finally disappear.
The managerLogin uses to test $_SESSION[’mgrValidated’] to now if a user is login or no, like i do in my snippet. Why should i have to refresh the page after login or logout to have the good content on my page
Here is my "autorisation" snippet code
$autorised = false;
if (isset ($_SESSION['mgrValidated'])) {
$uid = $_SESSION['mgrInternalKey'];
$result = modx->db->query("SELECT name FROM `modx_member_groups` as m LEFT JOIN `modx_membergroup_names` as n ON m.user_group = n.id WHERE member = '".$uid."'");
$names = mysql_fetch_assoc($result);
do{
if($names['name'] == $groupe)
$autorised = true;
break;
}
}while($names = mysql_fetch_assoc($result));
}
return $autorised;
And here is the order, things came in my page.
first managerLogin call in the page template. In the content of the page i call a snippet (uncached) which call (via runSnippet) my snippet "autorisation".
If someone could help...