I try before the <asp:login , but it make table and I had alot of problem with the compatibility in another browsers, and I want improve my asp.net skills
so I decided to make my own text box with buttons and checkbox (for remeber me button).
How to deal with the cookies and authenticate ?
I know I need write
if (Membership.ValidateUser(username_inserted.Text, password_inserted.Text))
{
but what next?
what to write after the "if (Membership.ValidateUser(...
{ " ... ?? how to authenticate the user ?
how to create cookie (if the user is check the "remeber me" checkbox) ??? (I'm using Encrypted)
after the user already log in , how to read the cookie after he did close the browser???
and when to read the cookies? each time page load?
cookieless="UseCookies" and timeout="10080" it's mean the
session or the cookie
save to 10080minutes ?
please mark as answer if this post answered your question
If you just want to provide a different layout, then you are not overriding the membership provider so that you can still call its functions to accomplish your job. You may find class FormsAuthentication helpful for your situations.
Because you are just using the default membership provider, you don't need to worry about the cookies, you can just call the functions under FormsAuthentication. If I remember correctly, there are functions you can set the cookie expiry and other things.
danielezra
Member
152 Points
88 Posts
Customize Membership Provider!
Mar 19, 2011 11:12 PM|LINK
I try before the <asp:login , but it make table and I had alot of problem with the compatibility in another browsers, and I want improve my asp.net skills
so I decided to make my own text box with buttons and checkbox (for remeber me button).
How to deal with the cookies and authenticate ?
I know I need write
if (Membership.ValidateUser(username_inserted.Text, password_inserted.Text)) {but what next?
{ " ... ?? how to authenticate the user ?
please mark as answer if this post answered your question
Small Peter
Contributor
2433 Points
484 Posts
Re: Customize Membership Provider!
Mar 21, 2011 01:28 AM|LINK
If you just want to provide a different layout, then you are not overriding the membership provider so that you can still call its functions to accomplish your job. You may find class FormsAuthentication helpful for your situations.
e.g.
if (Membership.ValidateUser( .., ..)
{
FormsAuthentication.RedirectFromLoginPage(username, false);
}
Because you are just using the default membership provider, you don't need to worry about the cookies, you can just call the functions under FormsAuthentication. If I remember correctly, there are functions you can set the cookie expiry and other things.
danielezra
Member
152 Points
88 Posts
Re: Customize Membership Provider!
Mar 21, 2011 09:11 AM|LINK
what is the functions for cookies?
please mark as answer if this post answered your question
Dave Sussman
All-Star
37716 Points
5005 Posts
ASPInsiders
MVP
Re: Customize Membership Provider!
Mar 21, 2011 10:35 AM|LINK
To set the cookie use:
FormsAuthentication.SetAuthCookie(UserName.Text, RememberMe.Checked);
hans_v
All-Star
35986 Points
6550 Posts
Re: Customize Membership Provider!
Mar 21, 2011 03:02 PM|LINK
You can convert it into a template
danielezra
Member
152 Points
88 Posts
Re: Customize Membership Provider!
Mar 21, 2011 08:06 PM|LINK
please mark as answer if this post answered your question
hans_v
All-Star
35986 Points
6550 Posts
Re: Customize Membership Provider!
Mar 22, 2011 11:01 AM|LINK
Click on the Smart Tag, and then click "Convert to Template"