In the electrolysis
At anode, oxidation reaction takes place and ions get oxidized.
At cathode, reduction reaction takes place and ions get reduced.
Thus, reaction at anode will be:
Cl−→12Cl2+e− E0=1.36V
2H2O→O2+4H−+4e− E0=1.23V
At anode, the reaction with lower value of E0 is preferred for oxidation. Thus, at anode O2(g) must have been produced instead of Cl2(g) but the formation of O2 at anode is kinetically so slow and needs some overvoltage to be additionally provided.
Thus, In electrolysis of aqueous sodium chloride solution Cl− is oxidised at anode.