is it safe to implement custom way of storing cookie in android?

i want to store session information in android application temporarily (as long as application is running). i am sending real-time data to node.js server from android client using Custom Protocol (over UDP). Along with this data i will send cookie (or session string unique to each user) to server for further processing. is this a safe way to store cookie in ram. Is this safe for users?

I am new to this security stuff so i want help. if i have missed any information i am willing to add it.