I need to store a value into session scoped variable in formHandler. Is it possible? For Example, i need to no.of times handleApplyShippingGroups is being called by a User (Session scoped) and write a condition based on that value whose effect is to that User only? But, ShippingGroupFormHandler's scope is "Request"? How to get through this?
There is no issue in that , request scoped components can refer session scoped components.
Just create a new session scoped component , or add a property to existing session scoped component like profile , simply update this value whenever handleApplyShippingGroups is invoked , and in your formhandler inject this value.
You can use the below logic.
$class = your.custom.Shippinggroup.fomhandler
//increment the value
Before that, add the property - applySgCallCount - to your profile with getter and setters.
Hope this helps.
Please keep posting the issues / updates.