Quote:

Does this look right?



No.

First off, the whole point of the group cache is to cut down on network calls and speed up the script. There is no need to flush the cache on every logon, just when changes are made to the groups.

You can flush the cache simply by deleting the reg key.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.