It's just a song, man. He never actually served time in Folson Prison, he just performed there. "Although he carefully cultivated a romantic outlaw image, he never served a prison sentence, although he landed in jail seven times for misdemeanors, each stay lasting a single night."
"While an airman in West Germany, Cash saw the B-movie Inside the Walls of Folsom Prison (1951), which inspired him to write an early draft of one of his most famous songs, "Folsom Prison Blues".
Cash felt great compassion for prisoners. As he wrote in his 1997 autobiography, he began performing concerts at various prisons starting in the late 1950s. These performances led to a pair of highly successful live albums, Johnny Cash at Folsom Prison (1968) and Johnny Cash at San Quentin (1969).
The Folsom Prison record was introduced by a powerful rendition of his classic "Folsom Prison Blues," while the San Quentin record included the crossover hit single "A Boy Named Sue," a Shel Silverstein-penned novelty song that reached No. 1 on the country charts and No. 2 on the US Top Ten pop charts. The AM versions of the latter contained a couple of profanities which were blipped out in that more-sensitive era. The modern CD versions are unedited and uncensored, and thus also longer than the original vinyl albums, giving a good flavor of what the concerts were like, with their highly receptive audiences of convicts.
Apart from his performances at Folsom Prison and San Quentin, and various other U.S. correctional facilities, Cash also performed at Österåkeranstalten (The Österåker Prison) north of Stockholm, Sweden in 1972. The recording was released in 1973. Between the songs Cash can be heard speaking Swedish which was greatly appreciated by the inmates.
Shortly after his historic concert at Madison Square Garden in the waning days of the 1960s, his son (and only child with June) John Carter Cash was born.
After he quit using drugs in the late 1960s and early 1970s, Cash rediscovered his Christian faith, taking an "altar call" in Evangel Temple, a small church in the Nashville area. Cash chose this church over many other larger, celebrity churches in the Nashville area because he said he was just another man there, and not a celebrity."