Do not edit any files. First, verify your Cookie Domain is correct in your Magento Configuration in
System > Configuration > Web
This should match the URL you are using to access the local store.
Otherwise here is an alternate method which also supports multiple local stores. In this suggestion you will be
1: adding a local domain in your local hosts file
2: updating your Apache configuration (if using MAMP/XAMMP)
3: setting this domain in your Magento Configuration Base URL and Cookie Domain.
This method uses the new local domain as the URL (http://local.domain.com/) and it consistant resolved any domain / login issues i've had.
Mac:
Open terminal (COMMAND + Spacebar, then type "terminal" and hit enter)
Type
sudo nano /etc/hosts
Add the following line to the bottom of your hosts file. Press CTRL+V to move to the bottom of the page, and add the following:
127.0.0.1 local.domain.com
Windows:
instructions here
Update your Apache configuration to add a VHOST directive as per instructions in my other answer here