Make sure there's no HTML being output to the browser before you redirect the script back to your framework script. The framework script is probably trying to set some session variables after the simpleauth script has already output something to the browser and so it fails with that error message (just guessing, you don't provide much info on the error message!).
See here:
http://forums.munk.me.uk/index.php/topic,109.0.htmlCheers.