Made a TpoSession class in login

It will be easier to use the cookies and sid generated using object oriented
approach.
Made appropriate changes in other files so that they can use this class.
Some other changes include checks and fixes to various bugs encountered.

Signed-off-by: Venkatesh Shukla <venkatesh.shukla.eee11@iitbhu.ac.in>