IF that is so then why did Emma not know who Capt.Hook was at her door at the end of the episode and kick him out and slammed the door in his face? I think you have it wrong. Emma and Henry were given false memories by Regina, as a gift of a life together since birth and Storybrooke the town never existed and they said that the people in the town would go back to where they were originally from (Enchanted forest) and become nothing more than stories in a book- at least in our world. The characters including Regina would not remember their time in this world or the events that happened in the last two years including Emma and Henry. IF you watch the last 15 minutes of the show this is detailed in the final comments before Regina does her magic to fight the curse spell.
The reason Emma & Henry lost their memories, was because everything about Storybrooke (including Emma & Henry's memories of it) were erased from our world. That is how Regina explained it to Emma when she told her they wouldn't remember Storybrooke. She gave them the false memories to cover the gap of her not having Henry. A gift to Emma & Henry so they wouldn't be alone without one another.
All the Storybrooke people that went back to the enchanted forest though, likely will keep their memories, as the reason for Emma & Henry not remembering doesn't apply to them.
Now if they all lost their memories, but Hook kept his can also be explained easily enough. Hook was never part of the curse, as he was still back in the enchanted forest (with Cora, Sleeping Beauty, and Mulan) while everyone else was in Storybrooke the last several years.