Download & Extend

CAS redirects to last "page not found" error on login

Project:CAS
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (duplicate)

Issue Summary

If a user is within our site and hits a resource, say an image, that is not found, then logs out and logs back in again, they get redirected to a "page not found" page with the url of the missing resource from their previous session.

This only occurs if we have the 'Force Redirect on login' option turned on.

Comments

#1

Can you tell me whether you're using private files or public (does apache handle image files or drupal)?

#2

Good question...
we are using public files. I have tried to turn that opion on and off in our devel environment and can still reproduce the error.

Once I get back home from DrupalCon, I'll start working through the module to find the cause....

#3

I'm seeing some occasional behavior somewhat like your seeing. I'm planning a major CAS code sprint in the next month or so, so I'll likely get to it then.

#4

Version:5.x-3.0» 6.x-1.0

Found the problem: the CAS cas_save_page() function sets the session variable 'cas_goto' for every item on the page which is not found, and therefore subsequently overrides the cas_goto page for the currently loaded page. Will look into if this can be overridden by having a custom 404 page and adding it to the exception list of redirected pages.

The module should probably check that the page exists before adding it to the session.

#5

Version:6.x-1.0» 6.x-2.x-dev

I've noticed this still happening, on occasion, in newer versions of CAS as well.

#6

True. The problem is a bit non-trivial. Often the pages that "don't exist" are pages like .ico files and things like that. If anyone has knowledge of how to do the test that's described above that works with wild-card urls and other such menu constructs, I'd love to try and take a stab at it. But it's something that I don't know how to do easily given Drupals complicated menu structure.

#7

It might be solvable by instead just having drupal itself do a drupal_http_request on the URL itself, seeing if the code is 404, and if so just setting the session redirect to the default redirect point.

#8

Status:active» closed (duplicate)

This is a duplicate of #1076510: Redirect to previous page on login.

nobody click here