Photon Message Bug

The photon chat message bug happens,
when your disconnected to photon then iRecieve function still receiving messages from the last login.
which I dont need anymore.
So if your newly login, how can I clear the messages stock to CLEAROUT, when I logout
So I will not recieve it when I login to photon