post_update() function updated

Now the function can work with either the user id or sessionId of an
user.