We have a problem with expiring logins.
In the current default install, about 24 hours after your last login, you will start receiving pages that look like you're logged in fine, but don't show you the things you have permission to see. There's nothing to tell you that you must refresh your login, nor is there a link to do so.
The workaround that I normally use is to click "Your Workspace", which will prompt a refresh, but take me to my workspace, then hit the back button twice, then refresh.
Obviously, this is unacceptable, and an unfortunate consequence of the new login scheme.
Here is the motivation for the current solution again:
- Logins that never expire is a bad thing, because if you just *once* accidentally leave a cookie on someone else's computer, you're doomed, the only way to fix it is to create a new account for yourself! (And I've seen too many posts of the type "oops, that wasn't Don posting, that was me, he just left his cookies on my box")
- I always liked very much that both Amazon and Yahoo shows you non-sensitive yet personalized information when you show up, but before you retype your password. Only if you click through a link from Your Account, or proceed to checkout, do you get prompted for a password. Also, when you do get to type in your password, they already filled in the username/email part, as they know that already.
So that's what I implemented for OpenACS, but with some unintended side-effects.
If we want to take advantage of this, long-term, we need to make the distinction between non-sensitive personalized information and sensitive personalized information in the system. That's tedious work that we can't get done for the current release.
An example of what needs to happen is this: When displaying the link to the site-wide admin pages, for example, it doesn't matter if your login is expired. But when showing the site-wide admin page, we do not accept an expired login. Hence, the check on the page that displays the link should check with [ad_conn untrusted_user_id], but the check on the site-wide admin page itself should use [ad_conn user_id], and require a non-null user_id.
So in the interim, here are a couple of other possible solutions:
1) Set to never expire logins by default. I don't think this is a good solution, because, as mentioned above, non-expiring logins are bad for your security.
2) Change the default page header to say when your login is expired and offer a link to refresh it. This is annoying, because it defeats the purpose of making you feel welcome immediately, and it's still confusing, because some things may not show up, and you have to recognize that fact, then realize that it's because your login expired, then refresh it. Poor usability.
3) Have a parameter, defaulting to on, that, whenever your login is expired, we automatically bump you to the login page to refresh. This would be safe, but prevents us from showing non-sensitive personalized information even for applications that know how to handle it.
4) Whenever you do a permission check with no -user_id flag (i.e., checking permissions for the current user), if there is a user with an expired login, we redirect to the login page to refresh the login.
5) Same as above, but we only redirect to the login page if the permissions check for "The Public" (user_id 0) returns 'false' and the same permission check with the expired login would've returned 'true', meaning you're seeing different results from what you would have.
4 and 5 above requires that we never pass in a -user_id of the current user when we want to check permissions for the current user. Alternatively, we could short-cut it and say that if you pass in a user_id equal to the current user, we do the same.
I think #1 and #2 above are ruled out. #3 offers a quick and safe solution. #4 offers an equally quick and safe solution with more of the benefits. #5 lets us postpone refreshing the login out a tiny bit longer, which is good, but not necessary until we've had time to think more about the use-cases.
I do think this is a seriously annoying bug right now, and
that we should get one of the solutions into the current release.
Comments?
/Lars