As gioi explained, the session id is only the user id inside a signed cookie.
This makes it really tricky to perform what your second question says (invalidating a session)
As an alternative to gioi's answer (but pretty similar), you can also replace Flask's Session implementation with one of your own, as explained in Flask docs.
This way, you could make a server-side implementation of Flask's Session and directly save the session id in the database.
Your implementation could generate a random session id cookie for each user which is associated with a user in your database (the database stores the session data, therefore it is a server-side implementation), and, through an ORM approach, Flask-Login would get the user id from there. There's also a config file which allows you to change from which attribute to get the user id, in case your column doesn't have the same name.
As an easier approach, you can also have a look at Flask-Session which already implements some of this server-side sessions.
Another option (but a bit hacky to my way of thinking) would be using Flask's request_loader
callback instead of the traditional user_loader
callback to load the Session ID. You could then create your own cookie to store the session ID and Flask-Login would retrieve it from there with the request_loader callback.