Oi!

I have wanted a returntosamepageafterlogin-feature on my site for a long time. But whats the best way?

I was thinking about saving the url into a session and when he/she logins, i check if the returnto-session if set, if it is, i redirect to that page

Is that safe/good?