ID:170494
 
I've noticed calling CGI.Login() redirects the user to the page they clicked in from, but CGI.Logout() brings them to this page. Is there anyway to change this behavour? It would make login and logout links on DMCGI websites a bit smoother.
Glancing at the code in CGI.dm reveals that Logout() takes an optional argument:

Logout(new_url)
return ..() //handled internally by DreamDaemon


Sure enough, Logout("http://google.com/") redirects to Google after logout. The desired call would then probably be:

Logout(GetEnv("SCRIPT_URI"))


Not sure why Dan made the default stay at the BYOND login page, but perhaps we'll change it in a future version if that makes sense.
In response to Mike H
I've never looked through the CGI library in depth, thanks! I always figured it was like Login().


[Edit]
Oooh, cool Login takes an argument too, this makes things easy.


[Edit the second]
The argument doesn't work in Login(), but it returns to the page with authentication passed into href in Topic(), so it works.