On Wed, 10 Oct 2007, Neil Bradley wrote:

> I am using application-level security and have created a login page. I have
> added code to the top of other pages to re-direct to the login page if the
> user is the default "nobody" user. But, if the login is successful, I then
> want to re-direct back to the page the user was trying to reach (including
> any parameters to the URL used in the attempt to get to that page).
>
> Is there any easy way to do this? I don't want to have to create new
> parameters to pass between my pages just to preserve this information if
> possible.

There are a couple ways to do it.

1. In your login code, use

   xdmp:get-request-header("Referer", "")

to fetch the value of the page from which the user came, then use that
value in the redirect.

2. Even better (as not all browsers send the Referer header you want):
in the code that redirects to the login script, set a session field
value (xdmp:set-session-field()) which can then be used by the login
script, with xdmp:get-session-field().

In either case, you may also need to use xdmp:get-request-field()
to fetch the URL parameters.

All these functions are documented at

 http://xqzone.com/pubs/3.2/apidocs/AppServerBuiltins.html

-- 
David Sewell, Editorial and Technical Manager
ROTUNDA, The University of Virginia Press
PO Box 801079, Charlottesville, VA 22904-4318 USA
Courier: 310 Old Ivy Way, Suite 302, Charlottesville VA 22903
Email: [EMAIL PROTECTED]   Tel: +1 434 924 9973
Web: http://rotunda.upress.virginia.edu/
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to