The security settings in Safari might prevent you from storing cookies, try changing them. I don't know any specific details about problems with cookies in Safari, but if it only happens with cookies from localhost, there should be no problems since I assume your visitors won't be browsing the site on that machine.
If the problem persists after changing the settings, post any errors you get, including the whole code. (Remember to check the JavaScript console, i think Safari has one like FF does.)