I am making an iOS application that requires me to login to my node.JS based web server.
Can anyone point me towards a tutorial, that throws some light on, how to generate unique token for one login session ?
What I have in my mind is, to get a username and password via post request,
validate the credentials, and then generate a hash of timestamp along with username and some secret and generate an authentication token, and send it back to the client to save it and use it further.
this session document will have session data and session_id being the unique key.
adding the answer here for clarity:
Is the username unique? then hash it out + time.