I find it to be kind of endearing when people ask to be in a photo with me, so long as they respect my boundaries. It's almost like being a face character at a theme park, though, so some cosplayers don't like it since it takes away from "being" the character.
Personally, I'd just advise taking the cosplayer's lead and make sure they're okay with you being in the photo. You can put an arm around them (which, like touchmon said, is tons preferable to ask first, not just for comfort levels, but also because some costumes break easier than others), and if they seem comfortable with it (They don't move away or move your arm off for you), then you can leave it there. If they do move away/your arm, don't force it, and just smile for the camera, throw a peace sign or something like that with your free hands. If they go into a different more-actiony pose, just roll with it and get into a similar pose yourself or something like that. If you're wanting anything in particular, that's when you'll want to make sure to explicitly ask for it (i.e., picking up the cosplayer (Which I personally never agree to), a hug, etc.). Just watch their reactions, as it will tell you how comfortable they are with what you're doing.
Most people generally rule that when dealing with cosplayers, asking first is key. Just ask them like you'd ask a family member for something. Be specific with what you're about to do, and the questions shouldn't be too hard to form.