don't store private public-share-key in session

proposed solution for #12405 

cc @DeepDiver1975 @LukasReschke @MorrisJobke what do you think?
these functions are still called non static in some cases in this class - please consider private visibility because these methods are only used in this class afaik - thx