How to log a user in via script



in SS3, you can do this

but it seems not working any more?


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


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


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


@DorsetDigital great!