I’ve been writing a short story detective series since back in high school. For the longest time this series was just something fun that I worked on in between trying to get other more serious stuff published or when I had writers block or when I got bored with the serious stuff. However, over the years I’ve grown as a writer and so to have these stories. The plots have become more intricate the characters have developed real identities and even the fictional city it’s based in has formed a solid foundation. The city and it’s inhabitants have become so well developed that it’s almost like a real place for me. Don’t worry I’m not crazy, well I’m a writer so I’m bound to have a few crossed wires upstairs, but I’m not delusional I know it’s not real. I'm just trying to say this city, for me, has become something along the lines of Faulkner’s Yoknapatawpha County. Not that I’m comparing my ability, only that like him I have a fictional arena in which many of my stories and a few novels take place. I think I’m beginning to mature enough as a writer that I will be able to start looking for representation again in the near future. In the mean time I’ve been considering submitting some of the detective stories to a Hot Rod magazine I’m fond of. Based on some of the short stories they’ve published in the past I think it would be a good fit. They don’t pay much but hell I ain’t F. Scott and they ain’t the Saturday Evening Post. The thing I’m concerned with is the creative rights. If one of my short stories gets published by a magazine would that fictional city and it’s inhabitants be lost to me forever or would I be able to carry on as Faulkner did with Yoknapatawpha County? Not all of my work revolves around this fictional city but enough of it does that I’m not willing to give it all up for a single publication.
The publication should have an Agreement that you sign if they want to publish your work. Look carefully at that to see what rights they are acquiring. For short stories, the acquired rights are usually limited in scope and duration. It is unlikely the magazine would require a transfer of copyright, for example. The copyright typically remains with the author. It is highly unlikely that the magazine could prevent you from continuing to write stories set in that city, and with those characters, and even more unlikely that they would wish to. But definitely read the agreement carefully - it's a good thing to do for any number of reasons.
The majority of magazines are acquiring first serial rights when they pick up a short story or article, which basically grants them permission to be the first to publish that particular story/article. After they've published it, you can do with it as you will (publish it elsewhere, add on to it, etc.). This can vary from place to place, so as Steerpike said, be sure to check what type of rights they are asking for beforehand. Some other rights include: geographical rights, second serial rights, electronic rights, simultaneous rights, etc. Magazines and other publications usually list what rights they require on their submission guidelines.
ditto all that... study the contract carefully... there should be no reason why you can't use the same setting, or even the same characters... if any contract limits your ability to do so, don't sign!