ns_internalredirect - Re-authorize and restart url processing
The "ns_internalredirect" command enables re-authorization and restart of a connection as if it where originally for a different location (relative URI). It is possible now to set new request location and re-process the request from the beginning without using external redirect. Internal redirect assigns new URL and calls registered proc for new URL inside the existing connection and using the same Tcl interp.
if { $login } { ns_internalredirect /main return }