How to log a user in via script


in SS3, you can do this

but it seems not working any more?

it actually works. forget to force the page to reload.

Just FYI, there is also a Member::actAs($member, $callback) which might be useful, depending on what you’re trying to do.

Take a look here: Log in a member - Silverstripe 4

@Tim great!