[feature/session-storage] Eliminate duplicate query code

Changed native session storage to use the class
query function to eliminate code duplication.

PHPBB3-9733