mehmetc / jQuery.PRIMO

A client side convenience library for PRIMO.
MIT License
27 stars 8 forks source link

jQuery.PRIMO.session.user.isOnCampus(); requires Browser restart - jQuery.PRIMO.session.reload() does not work? #3

Closed jhercher closed 9 years ago

jhercher commented 9 years ago

Hi Mehmet,

finally had some time to test your Framework - thank you for your effort!

I have a issue with Firefox and Chrome. It looks as if I need to restart the browser to get the correct return value from jQuery.PRIMO.session.user.isOnCampus()

not logged in via VPN:

start FF
jQuery.PRIMO.session.user.isOnCampus();
-> false // ok

starting VPN 
-> false // not ok

jQuery.PRIMO.session.reload();
Fehler: TypeError: this.__FireQueryShared is undefined //don't get this in chrome

jQuery.PRIMO.session.user.isOnCampus();
-> false // not ok

Restart Browser (still logged in via VPN)

jQuery.PRIMO.session.user.isOnCampus();
-> true // ok

logout from VPN
jQuery.PRIMO.session.user.isOnCampus();
-> true // not ok

jQuery.PRIMO.session.reload(); //same as above

Restart Browser
jQuery.PRIMO.session.user.isOnCampus();
-> true // ok

At some point while debugging I saw FF could not find a primo_library/libweb/getUserInfoServlet. While the header.html, and remote_session_data_helper are in place, I could not find a getUserInfoServlet on the server nor your sources.

Oh and I need to mention that I have altered the base_path (on line 14: in jquery.PRIMO.js) to a subdirectory, i.e. /primo_library/libweb/my/path/jsp

Cheers, Johannes

mehmetc commented 9 years ago

Hi Johannes,

Great that you are checking out the library!

The reload will work If you disable the FireQuery plugin in Firefox. I do not know why FireQuery is throwing an error that is something that needs more investigating.

If you still get the odd behaviour after disabling the plugin than we can use UserContext.isOnCampus on the server to check the status. It could be that SessionUtils is only initialised when your session is created.

Mehmet

jhercher commented 9 years ago

Hi Mehmet,

deactivating Firequery helped to circumvent the error in FF on jQuery.PRIMO.session.reload(); Thanks!

The key issue is still present: I need to restart the browser to have a correct onCampus status. How do I make use of UserContext.isOnCampus on the server ?

Cheers, Johannes

mehmetc commented 9 years ago

I updated server/remote_session_data_helper.jsp. Btw /primo_library/libweb/getUserInfoServlet is native to Primo. window.getUserInfo() will load it. I'm using it as a fallback if the JSP pages are not found.

jhercher commented 9 years ago

Awesome...Thank you!