views:

200

answers:

5

I want to create a website that the login system shouldn't be handled by cookies, but on (a) table(s) in the local (on the server) SQL DB.

Is there a way to do it? Even no partial way?

What and where should I save instead of the cookie???

+1  A: 

Cookieless ASP.NET

If you need help actually implementing the login system you'll need to include more details about your specific problem.

Paul Alexander
+1 - completely ignored this method
John Rasch
I updated the question
Shimmy
A: 

Use the SqlMembershipProvider.

Joel Coehoorn
How does that obviate the need for Cookies, Joel ?
Cerebrus
It answers the other half of the question - how to implement a login system driven by a SQL database...
GalacticCowboy
In other words, don't reinvent the wheel.
GalacticCowboy
+2  A: 

You still need some way of telling the users apart. If you don't use cookies, then you will have to transfer that information in url or allow only one user from a single ip address (this is really stupid) ... or something else. Cookies are not that bad :-).

cube
+1  A: 

You can store your usernames and so in a database, but you will still need a way to recognize the user as he/she navigates from page to page. That is the cookies role in this, to persist this login token...

It is possible to implement some other ways of handling this token. One can use the URL or somme hidden fields (as ASP.NET's ViewState) to store this token.

So, yes; it can be done. But it takes some work, since you can't use what ASP.NET already provides you. (ASP.NET has builtin-features to handle this token as a cookie, and also store the credentials in the database.)

Arjan Einbu
+2  A: 

ASP.NET uses Session cookies by default to track user requests. If you use Cookieless sessions, you will find the Session ID being appended in all requests from the browser. In many scenarios, this could also be unacceptable.

Even if you decide to hit the database and check for a "LoggedIn" flag upon each request, you still need some way to identify the incoming request as belonging to a particular user. This could be in the form of encrypted values in hidden fields, depending on your security scenario. That said, it's not a much better method than the use of cookies, because any data that comes from the client has the potential to have been tampered with.

Personally, I think Cookies are great to track user requests as long as you encrypt them properly.

Cerebrus