Hallo Rene,
ich hab hier ein Beispiel, vielleicht hilft das.
Wenn "Remember my credentials" gew�hlt wird,
ist das Cookie permanent (lt. WROX 50 Jahre!?)
Gru�, Matthias
1. default.aspx
<%@Page Language="C#" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title></title></head>
<body>
<div id="msgHello" runat="server" /><p />
<script language="C#" runat="server">
void Page_Load(object sender, EventArgs e)
{
if (User.Identity.IsAuthenticated)
{
msgHello.InnerHtml = "Hallo, Du bist drin!";
}
}
</script>
2. Login.aspx
<%@Page Language="C#" %>
<html>
<head>
<title>Login Form</title>
</head>
<body>
<form runat="server">
UserName: <input id="txtUsr" type="text" runat="server" /><p />
Password: <input id="txtPwd" type="password" runat="server" /><p />
<ASP:CheckBox id="chkPersist" runat="server" />
Remember my credentials<p />
<input type="submit" value="Login" runat="server" onserverclick="DoLogin" /><p />
<div id="outMessage" runat="server" />
</form>
</body>
</html>
<script language="C#" runat="server">
void DoLogin(Object objSender, EventArgs objArgs)
{
if (FormsAuthentication.Authenticate(txtUsr.Value, txtPwd.Value))
FormsAuthentication.RedirectFromLoginPage(txtUsr.Value, chkPersist.Checked);
else
outMessage.InnerHtml = "Falsche Anmeldedaten ...";
}
</script>
3. web.config
<configuration>
<system.web>
<authentication mode="Forms">
<forms name="Test" path="/" loginUrl="Login.aspx"
protection="All" timeout="30">
<credentials passwordFormat="Clear">
<user name="Test" password="Test" />
</credentials>
</forms>
</authentication>
<authorization>
<allow users="Test" />
<deny users="?" />
</authorization>
</system.web>
</configuration>
_______________________________________________
Asp.net mailing list
[EMAIL PROTECTED]
http://www.glengamoi.com/mailman/listinfo/asp.net