I've created my own login page with a loginname and password textbox. After the login button is pressed I do the following:
/// <summary>
/// Login the member.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void LnkBtnLogin_Click(object sender, EventArgs e)
{
Member member = Member.GetMemberFromLoginNameAndPassword(TxtUserName.Text, TxtPassword.Text);
if (member != null)
{
//If the member is not null it is found and can log in.
Member.AddMemberToCache(member);
//Redirect to the welkom page if after the member logged in.
Response.Redirect(umbraco.library.NiceUrl(Configuration.LoginWelkomPageId));
}
}
This code works, but the member stays logged in even after leaving closing the browser. This should only be done if the member has a checkbox checked. Otherwise the member needs log in again after closing the browser. Does someboy know how I need to change my code for this?
Login without saving login data.
Hello,
I've created my own login page with a loginname and password textbox. After the login button is pressed I do the following:
/// <summary> /// Login the member. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void LnkBtnLogin_Click(object sender, EventArgs e) { Member member = Member.GetMemberFromLoginNameAndPassword(TxtUserName.Text, TxtPassword.Text); if (member != null) { //If the member is not null it is found and can log in. Member.AddMemberToCache(member); //Redirect to the welkom page if after the member logged in. Response.Redirect(umbraco.library.NiceUrl(Configuration.LoginWelkomPageId)); } }This code works, but the member stays logged in even after leaving closing the browser. This should only be done if the member has a checkbox checked. Otherwise the member needs log in again after closing the browser. Does someboy know how I need to change my code for this?
Hi Jeroen,
I'll suggest you use the normal ASP.NET Login control. I haven't experienced these issues with the normal asp.net controls.
Cheers,
Richard
Thanks Richard! I'll try those. Do I need to make any changes for this or is just placing the login control enough?
Just add the login control and you are good to go,.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.