At 15:21 06/25/2004, you wrote:
If I issue a redirect to another page in my site is it possible to detect via Active4D commands where the redirect came from without passing the source as a query parameter?

I'm redirecting to a login page under certain circumstances. Upon successful login I'd like to take the user back to where they first tried to go.

Maybe it's obvious but why you just don't store the url in a session variable ?

That is a good idea but in this case I haven't started the session yet. That happens when the the user successfully logs in.


I don't use automatic sessions because there are some simple Active4D web apps on the same server that don't need sessions.

Passing the original url in a query parameter seems like the best solution.

'request info{"referer"}' will tell you the page you came from, then you can put a simple flag in the query instead of the entire url.

Aparajita,

"Referer" is what I was looking for, but in my testing 'referer' contains the URL for the page that contained the link to the Active4D page that does the redirect. I need to know the Active4D page that did the redirect.

On this particular site I have a page_init method in place on (almost) every page that redirects to a login page if Active4D can' identify the user via a uid cookie or an active session. Once they are logged in, I set the uid cookie, start the session and redirect them back to the original requested page.

Also, if the user types in the page URL in the address bar 'referer' doesn't appear in the "request info" collection. This is how I was testing earlier today. I didn't see a 'referer' when I debugged with "dump request". That led me to ask the list.

In thinking about the observed behavior, I'd agreee it working as it should. If a request is new, i.e., via the address bar, there isn't a referer. I haven't researched how 'referer' should be handled in the event of a redirect, but would suspect that the URL that contained the redirected link is correct. In my case I'd have to change referer, and since "request info" is read-only I can't do that (for good reason).

best,

Brad

_______________________________________________
Active4D-dev mailing list
[EMAIL PROTECTED]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to