[coldbox-4.1.0] setNextEvent() with hash sign in original url (fragment)

Let’s say in your main handler you have the following two events

If you hit the first one like [your site]/main/test1/blah/1 where url var “blah” has a value of 1 then your browser will redirect to [your site]/main/test2 .
If you hit the first one like [your site]/main/test1/blah/1# where after the url var “blah” there is a # sign appended then your browser will redirect to [your site]/main/test2#, leaving the fragment in place in the url itself. Is this intended?

I’ve started using a social auth module and both Google and Facebook return url vars with these fragments on the end ( Google returns “…&prompt=none#” and Facebook returns "…state=ABC123#= " ). When I use setNextEvent() to go somewhere the # or #= is maintained in the URL. I searched around the docs and here and didn’t see anything. Maybe searching wrong thing or just having a brain dropout at the moment bu thought I’d post here.

Thank you!

Irv

This appears to be a browser behavior where the URL fragment is carried over on 30X redirections. Read more here:
http://stackoverflow.com/questions/2286402/url-fragment-and-302-redirects

Also, here’s a little simpler way to write those bulky functions :slight_smile: That’s an 80% reduction in noise!

function test1() {
setNextEvent(“main.test2”);
}

function test2() {
writedump( rc ); abort;
}

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Brad,

Yes, that makes sense.

Thanks!

Irv