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 URL. It is possible now to set new request url 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 }