If a user hits /user/login and they are already logged in, Drupal says

Access Denied
You are not authorized to access this page.

Though technically correct, this is confusing for many users, and is causing us a LOT wasted tech support time. We've worked around this in the past with a custom module - but it would be really really really great to get this fixed in core.

Could Drupal perhaps say
"You are already logged in."

or even better, just redirect the user to their user page, and show a status message.

similar pages with the same, or reverse problem;
/user/register - if logged in you get Access Denied.
/logout - if NOT logged in you get Access Denied.

This does appear to have been fixed in Drupal7 would a back port or similar fix be possible for D6?

I just noticed that going to /user/logout in D7 also returns Access Denied - while a user is less likely to encounter this, it would be better if it said

"You are not logged in"

Comments

Anonymous’s picture

Status: Active » Closed (works as designed)
kattekrab’s picture

Status: Closed (works as designed) » Needs review

If this "works as designed" - then Drupal is flawed, and is wasting the time of site users, and the teams that support those users.

Please re-consider fixing this.

It has been fixed in D7 - it should be backported.

This should not be a contrib work around. It should be fixed in core.

Anonymous’s picture

Status: Needs review » Closed (works as designed)

If you wish to offer a feature request for 8.x series fine. The fact is "access denied" is just as valid as anything else and is in fact a robust solution since a logged in user can't login again and is "works as designed". Therefore it cannot be a bug but the functionality can be modified by you creating a hook_menu_alter which is also "works as designed".

damienmckenna’s picture

For completeness, #363580: OpenID login fails when in maintenance mode is an in-progress patch that covers this issue.

jwilson3’s picture

Version: 6.20 » 8.x-dev
Category: bug » feature
Status: Closed (works as designed) » Active

This is a usability issue and a feature request. Imagine the case when a novice site user is logged into your site and gets a cookie set that leaves them logged in, and then leaves the site for a few days. They don't know about cookies and so the next time they go to login they click a link in an email to /user/login... and, bam, the first page they see, their second interaction with the site gives them Access Denied, with no explanation as to what is going on.

jwilson3’s picture

Version: 8.x-dev » 6.x-dev
Category: feature » bug
Status: Active » Closed (fixed)

Gar. I totally mis-read this. It's fixed in D7 and thus D8, but not D6.

damienmckenna’s picture

Version: 6.x-dev » 8.x-dev
Category: bug » feature
Status: Closed (fixed) » Closed (duplicate)

This is already fixed in D7, thus D8, the issue I linked to above enveloped this bug and others, the remaining question is whether this will be backported to D6.

kattekrab’s picture

Would be seriously great if this could be backported to D6.

sillygwailo’s picture

For people looking for a Drupal 6 solution, try the Already In module, which redirects users to a page administrators can specify, defaulting to the user profile, and setting a message saying that you're already logged in. Config for the module is at admin/settings/already-registered.

AmolB’s picture

Issue summary: View changes

@sillygwailo, thanks for suggesting already_in module. It worked for me. I was working on a Drupal 6 site and was stuck on an issue. This module worked for me.