It'll "arrive" into the WebHandler procedure. So this is where you'd trap it, and do additional information.
I'd lean towards the _SendFile method, after the parent call, something like this;
if self.pagename = 'SetSessionValue' and self.RequestAjax = 1
! parse self.WholeURL and do extra work if required
end
update: I've added a method in 6.47 and later called SessionValueSetFromBrowser. this takes the name, and value as parameters. So you would put your code in here. (and you'd more easily have access to the name, and value so it would be simpler.)
Cheers
Bruce