session management and various scopes in dsp

i want to store value under session scope in one dsp and retrieve session value in other dsp,like we do in jsp using session.setAttribute and session.getAttribute.
please give complete step by step process to achieve this.
1.how to create session.
2.how to store value in that session.
3.how to retrieve session value.
Also can we write java code in dsp.
According to session value i want to do some operation in my dsp.