Can the OS X keychain juggle two accounts for the same site? I have a different passwords for:


www.example.com/foo/login and
www.example.com/bar/login


It seems as if the keychain only saves the passwords in relation to the sitename as it does not make distinctions by the subdomain.

When I visit www.example.com/foo/login the keychain will save the password correctly, but when I visit www.example.com/bar/login afterwards it uses the password of the first page and doesn't let me create a new password for the subdomain.

Is there any solution to this problem?
No - you'll want a more full featured password manager like the one gentmatt recommended in the comments.

You could do some kludgey web proxy to give the subdomain a separate top level domain, but that's way more hassle than most would consider appropriate for solving the problem you pose.