No, they don't both mean "only". :)
Literally, "прoсто" is "simple"(as adjective for neuter) or "simply" (as adverb) and "сaмо" is "only"(as adverb or conjunction) ... but, well ... just ... it's not that simple ... :D.
Quite often, (and I guess this is the most confusing thing for you) they both are used as synonyms in the place of the english adverb "just" (of course with the meaning "merely,only" or "simply; certainly" and NOT "Precisely; exactly")