How to implement session in ionic?

I want to implement session using ionic 2 please help anyone. if possible give me an example of code.

You probably don’t. Please describe in larger terms what you mean. If you are talking about authentication, you want JWT.

actually i want to hold the value in a session variable

Please forget everything you know about your issue. Now read what you have written here. What do you think? What further information would you want to have as somebody trying to help you?