codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  all page security with a cookie  mhamini at 12:20 on Tuesday, November 02, 2004
 

hello.
i have an ASP.NET login page. this page related to a SQL Server 2000 database and check username & password and if true , redirect people to first page of my site , for example "/forum/firstpage.html" ... if a user directly write the address of my first page (not address of my login page) , he/she will be entered to my site without login!!! it is my problem. i think if i put a cookie to user's system when he submitted to my site (and loginned successfully) , and i check "existing" of this cookie in the top of all pages of my site , no one can access to any page of my site directly. is it a solve? ... if it is , can you help me about a code that check "existing" of a cookie in a hard disk? ... i need a code to do this and if you have a better suggestion about my problem , help me by telling that to me.
thank you reader...


  Re: all page security with a cookie  tgreer at 13:56 on Tuesday, November 02, 2004
 

The "better way" is to use ASP.NET's built-in security methods. Their is a "Security" class in the .NET Framework. It handles all the cookie authoring and checking, plus redirection to a login page, for you.

You need to research "Forms Authentication". A Google search for "ASP.NET Forms Authentication" will reveal hundreds of results, with articles and tutorials.

You can then take if from their, by writing custom authentication code if you like.

Thomas D. Greer
www.tgreer.com









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: database and time date exire
•  Re: Column count
•  Re: Page Load
•  Re: error in using
•  how to acheive this in C++
•  Re: Testing file for type of data
•  Re: javascript and jsp
•  Re: all page security with a cookie
•  Re: calling functions from JS-generated HTMLpage


Recent Articles
Communicating with the Database (Using ADO)
MagicGrid
Simple Thumbnail Browsing Solution
Type Anywhere
A Better Moustrap: FmtDate to replace FormatDateTime
ASP.NET Forum Source Code
Internal Search Engine
Javascript Growing Window
Simple date validation
Search engine friendly URLs using ASP.NET (C#.NET)


Site Survey
Help us serve you better. Take a five minute survey. Click here!

© Copyright codetoad.com 2001-2004