1- you must be redirecting to the same domain name
2- cookies must be enabled
3- do not mix subomains
eg:
[url]http:///foo.com[/url]
[url]http:///www.foo.com[/url]
[url]http:///subdomain.foo.com[/url]
as far as the browser is concered, all 3 are completely distinct domains, and cookies will not be shared between any of them unless you explcity tell the browser to do so. yes, www.foo.com is NOT the same domain as foo.com, most servers are just configured in a way that makes people beleive they are.
so if they log in on [url]http:///foo.com[/url] and get redirected to [url]http:///www.foo.com[/url] most browsers will not send thier authentication cookie, which would of course cause the login prompt to appear again
its easy in php, but i dont know how to configure apache to do that. im sure it can be done though