Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
how do I automatically login a user in my c# code?
In older Version, ich could just do this:
Member m = Member.GetMemberByName("username",true).First();Member.AddMemberToCache(m, false, new TimeSpan(10, 0, 0, 0, 0));
But in 7 it is recommended to use Memberservice.
Anyone has a code example for me how to do it in seven?
Tanks.
Hi Tom,
maybe this can you help:
http://our.umbraco.org/Documentation/Reference/Querying/MemberShipHelper/
Sören
The link Sören provided should show how to do the trick. But it seems that the link is somewhat broken while he has done the copy/paste of it.
So to make it short: Mermbers.Login(username,password); should do the trick in v7.
Where "Members" is an instance of the MembershipHelper provided by your controller, view and so on.
Hi David, hi Sören,
works great. Thanks for the support!
Tom
mark the solution post to solved, please ;-)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
addMemberToCache / Code Authentication in umbraco 7
Hi,
how do I automatically login a user in my c# code?
In older Version, ich could just do this:
But in 7 it is recommended to use Memberservice.
Anyone has a code example for me how to do it in seven?
Tanks.
Hi Tom,
maybe this can you help:
http://our.umbraco.org/Documentation/Reference/Querying/MemberShipHelper/
Sören
The link Sören provided should show how to do the trick. But it seems that the link is somewhat broken while he has done the copy/paste of it.
So to make it short: Mermbers.Login(username,password); should do the trick in v7.
Where "Members" is an instance of the MembershipHelper provided by your controller, view and so on.
Hi David, hi Sören,
works great. Thanks for the support!
Tom
Hi Tom,
mark the solution post to solved, please ;-)
Sören
is working on a reply...