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. to create session. to store value in that session. 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.