Setting session values in database hooks

Is it possible to set a session variable in a database hook? For example, I tried to set a session variable in the “After Insert” hook of a database, but the value was always empty when trying to retreive the session variable in a page.

Thanks!

I just read this line in the Wix code API reference.
" The APIs in wix-storage can only be used in front-end code. "

I was able to solve this by setting my session variable using the onAfterSave( ) function in the wix-dataset API.