Redirect user to previous page after login?


Hi, I’m trying to redirect user to the previous page after they logged in,
Is there any way to implement this function?
I found event api in the doc, and tried to pass a url as parameter like below,


and use header to redirect user, but it doesn’t work out…

I’m wondering if anyone had ever try to do this before? Or if you have a good idea about this?

P.S. I’m using pimcore 4