97 Nissan Altima with battery issues

I have a 97 Nissan Altima with 99,000 miles. I have replaced the alternater twice in the last four years. I just recently began seeing the battery and brake light turn on occaisionally and therefore replaced my battery thinking this was the issue. I have now come to realize that the battery/brake light only comes on when the air conditioner is on. And then only if the car is in stop and go traffic. In other words, the light does not appear when driving on the highway regardless of the ac or when in traffic when the ac is off. The alternater must be working because when I turn off the ac, after a few minutes the light goes off. What could be the problem and what should I do?

I could understand the alternator light coming on if it wasn’t charging or the engine rpms are too low. The A/C load causes the engine rpms to drop. But the brake light too?

It would appear that the alternator is failing to provide full output.  I suggest that you have both the battery and the charging system checked out at a local auto parts store.  Many will do this for free.  

Note: The cheap rebuild alternators available at most auto part stores have a tendency to not last long.  A quality rebuilt is fine.  The problem is knowing the difference.  A good local mechanic will know from experience where to get quality rebuilds.