Click here to Skip to main content
15,886,788 members
Articles / Web Development / ASP.NET

Cookieless ASP.NET forms authentication

Rate me:
Please Sign up or sign in to vote.
4.35/5 (47 votes)
25 Aug 20023 min read 536.4K   3.3K   114  
They say it is not possible to use cookieless forms authentication in .NET. Well it is, and relatively easy to accomplish!
<%@ Page language="c#" Codebehind="login.aspx.cs" AutoEventWireup="false" Inherits="samplecookieless.login" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>login</title>
		<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
		<meta name="CODE_LANGUAGE" Content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
	</HEAD>
	<body MS_POSITIONING="GridLayout">
		<form id="login" method="post" runat="server">
			<asp:TextBox id="TextBox1" style="Z-INDEX: 101; LEFT: 301px; POSITION: absolute; TOP: 265px" runat="server" Width="130px" TextMode="Password">The password here</asp:TextBox>
			<asp:Button id="Button1" style="Z-INDEX: 102; LEFT: 324px; POSITION: absolute; TOP: 308px" runat="server" Text="Let me in!"></asp:Button>
			<asp:Label id="Label1" style="Z-INDEX: 103; LEFT: 278px; POSITION: absolute; TOP: 233px" runat="server">Type in "go", and press button</asp:Label>
		</form>
	</body>
</HTML>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Hungary Hungary
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions