1

In my Controller I created a script to add a user to the database, is there a way I can automatically:

1) Log them in and 2) Set a permanent session cookie or similar?

I basically don't want the user to have to ever log in and we will be creating the accounts for them.

3

You're probably looking for a combination of:

craft()->userSession->login()

or

craft()->userSession->loginByUserId()

along with setting the userSessionDuration config setting to a really high value.

2
  • Have these linked resources moved to a new URL? – buck1112 Oct 3 '18 at 20:44
  • @buck1112 yup... updated! – Brad Bell Oct 6 '18 at 8:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.