1

I maintain a single-page application that uses the YUI 2.8 history module to retain local options in the URL fragment. I've recently put it behind CAS authentication, and I'm finding that the fragment gets lost during CAS authentication. It is retained in the signon URL, but not when redirected back to the application page. This is also true after session timeouts, so users get bumped back to the default options after re-authentication.

Any suggested strategies for hanging on to the fragment (or the underlying javascript state) though a CAS roundtrip?

Dan Percival
  • 293
  • 2
  • 8
  • I'm working on the same issue, except I'm using Angular and YUI. I'd like to hear what others have to say – Jason Aug 29 '12 at 21:02

1 Answers1

1

You can store it in a cookie, sessionStorage, or simply as the value of window.name if there are no security implications:

//Cookie
document.cookie = "fragID=" + window.location.hash + ";path=/";
//Session Storage
window.sessionStorage.setItem("fragID",window.location.hash);
//Window
window.name = window.location.hash

References

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265
  • Sorry not to have seen and accepted this answer already. What I ended up deciding on, since I wanted to accommodate multiple windows open with different view options, was to store in a cookie that I only read in the absence of the URL fragment. – Dan Percival May 24 '13 at 18:18