First of all I'm going to write my question in brief. I wanted to catch a event and wanted to use the event to store some value in my session to recognize that event in rest of my site unless the session is destroyed by somehow.
To call the server using ajax is a method of experts and honestly speaking I don't know much of it. So I needed to look for something what i already know. Of course based on php. Finally I got the COOKIE.
This has a fallback. If user disables the cookie then you won't have the option to use it.