Session code functionality fixed