Anvil.server.session in uplink code

I was trying to use anvil.server.session property inside a server uplink file, which runs on my computer. When I try to use it or handle the session expired case, I’v receiving an error:
(this code is just a simple test simply for testing the functions)

import anvil.server
...

@anvil.server.callable
def login_user(username, password):
	...
	if user is not None:
		#save user for session
		anvil.server.session["user"] = user

 


Error  module 'anvil.server' has no attribute 'session'

or trying to handle session expire:

import anvil.server

...
    try:
		user = anvil.server.call("user")
	except anvil.server.SessionExpiredError:
		anvil.server.reset_session()

AttributeError: module 'anvil.server' has no attribute 'SessionExpiredError'

When I run the very same code in a server modul loaded in Anvil (so runs under Anvil’s server) it works.
When I run it on my server via uplink code it does not work.

Any idea why is this? Is this a limitation or am I missing something here?

As a workaround I’m using an anvil server side code like a wrapper/proxy to access to my server uplink code, this way the anvil server modul call my uplink code and handle the session, store some session data. All the logic stays in my uplink code, but the client calls going through of the server’s module in these few special cases.

I also checked and updated the uplink code via pip

Installing collected packages: argparse, anvil-uplink
  Attempting uninstall: anvil-uplink
    Found existing installation: anvil-uplink 0.3.42
    Uninstalling anvil-uplink-0.3.42:
      Successfully uninstalled anvil-uplink-0.3.42
Successfully installed anvil-uplink-0.4.1 argparse-1.4.0

Thanks!