Click here to Skip to main content
16,012,843 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: UserConcurrency Pin
Populate1233-Dec-03 21:28
Populate1233-Dec-03 21:28 
GeneralConcurrency Metering Pin
eolss3-Dec-03 3:30
eolss3-Dec-03 3:30 
Generalsupplying <frame> content within same HTML file Pin
moredip2-Dec-03 14:48
moredip2-Dec-03 14:48 
Generalfile transfer!!!!! Pin
Mr. Cully2-Dec-03 6:39
Mr. Cully2-Dec-03 6:39 
GeneralRe: file transfer!!!!! Pin
moredip2-Dec-03 15:14
moredip2-Dec-03 15:14 
GeneralRe: file transfer!!!!! Pin
Populate1233-Dec-03 21:33
Populate1233-Dec-03 21:33 
GeneralSecure Cookies Pin
MatrixUndone2-Dec-03 6:05
sussMatrixUndone2-Dec-03 6:05 
GeneralRe: Secure Cookies Pin
Ian Darling2-Dec-03 6:28
Ian Darling2-Dec-03 6:28 
MatrixUndone wrote:
I am using cookies in my website to identify users... every user has username and password... I have an option for making the user remember his name...

Some users where simply able to modify the saved Cookie and change the name to use other user's names!!

The username in that case must be the same number of Characters as the stolen name...

How can Iprevent that in the most simple way?? is there a way to make the cookie more secure and prevent users from editing them??


That isn't really possible - cookies are just a text a file on the end users machine and they should be allowed to edit them if they really want to.

What you really need to do is provide extra checks to ensure that the cookie you wrote was the one that gets sent back later on.

You could use a hash of the username and password (and/or other suitable information) and store that in the cookie as well - this can be rechecked on your end quite simply, and if they don't match, then force the user to log in as normal. Whatever you do, the hash has to be generated from at least some information the "evil" user has not got access to - such as passwords you store in a database on your site.

If you generate a hash from just the cookie information, then an "evil" user can generate it too, using the information he wants in that cookie.

If you're using ASP.NET, investigate Forms Authentication, as this can provide the authentication facilities you're looking for.

--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
GeneralRe: Secure Cookies Pin
MatrixUndone2-Dec-03 7:14
sussMatrixUndone2-Dec-03 7:14 
GeneralRe: Secure Cookies Pin
Heath Stewart2-Dec-03 9:05
protectorHeath Stewart2-Dec-03 9:05 
GeneralRe: Secure Cookies Pin
MatrixUndone3-Dec-03 7:37
sussMatrixUndone3-Dec-03 7:37 
GeneralRe: Secure Cookies Pin
Heath Stewart3-Dec-03 8:19
protectorHeath Stewart3-Dec-03 8:19 
GeneralPlatform Confusion Pin
michael watt2-Dec-03 3:09
michael watt2-Dec-03 3:09 
GeneralRe: Platform Confusion Pin
Not Active2-Dec-03 4:14
mentorNot Active2-Dec-03 4:14 
GeneralRe: Platform Confusion Pin
michael watt2-Dec-03 8:44
michael watt2-Dec-03 8:44 
GeneralRe: dhtml/javascript/iframe/link inline html Pin
ZoogieZork2-Dec-03 2:17
ZoogieZork2-Dec-03 2:17 
GeneralRe: dhtml/javascript/iframe/link inline html Pin
Maximilien2-Dec-03 2:30
Maximilien2-Dec-03 2:30 
GeneralASP Session again Pin
BlackRider1-Dec-03 22:05
BlackRider1-Dec-03 22:05 
GeneralRe: ASP Session again Pin
Paul Watson1-Dec-03 22:47
sitebuilderPaul Watson1-Dec-03 22:47 
GeneralRe: ASP Session again Pin
BlackRider2-Dec-03 1:45
BlackRider2-Dec-03 1:45 
GeneralRe: ASP Session again Pin
Paul Watson2-Dec-03 1:52
sitebuilderPaul Watson2-Dec-03 1:52 
GeneralRe: ASP Session again Pin
BlackRider2-Dec-03 23:00
BlackRider2-Dec-03 23:00 
GeneralRe: ASP Session again Pin
Populate1233-Dec-03 21:39
Populate1233-Dec-03 21:39 
GeneralRegionInfo and CultureInfo (CurrentCulture/CurrentUICulture) Pin
CillyMe1-Dec-03 16:28
CillyMe1-Dec-03 16:28 
GeneralASP Sessions Pin
User 127821-Dec-03 14:00
User 127821-Dec-03 14:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.