I am looking for a way to make improve security (for logged in users) using serverside script (traditional ASP), cookies and perhaps IP addresses.
If you are interested, this is what I currently do (if not interested, just read the last few lines, and if not interested at all - I'm deeply cut.
When a user logs in to a site, the following is done:
- 1: A decent sized random number is generated.
2: A field in the user record in the db is updated with this number.
3: The user record ID from the database is embedded into the number, digits scattered throughout using a another random number and a simple formula which also generates a "key". The key is prepended to the string.
4: The string is sent to the user as a session cookie (it expires if the user disconnects or times out, or is forced to expire if the user logs out)
5: When the cookie expires the special field in the user record is blanked.
6: If a user logs in and the special field is not blank the field is blanked and the user chucked out - can retry login after a short time, by which time the first user is hopefully ejected (see below) and one or both kick up a stink
- 1: No cookie, user chucked.
2: The key is used to seperate the ID and the random number in the cookie data.
3: The record associated with that unique ID is retrieved from the DB.
4: If the ID is invalid, the user is chucked and the cookie removed.
5: The field in the record is checked against the random number, if different the user is chucked (blank fields being unequal also see the user chucked)
6: Session cookie is updated to expire after "n" minutes from this event.
(Some other standard stuff is done such as logging)
This has been okay so far, but now I want to make it more secure.
So ...
Any good ideas or thoughts on how to improve security (I am limited to using cookies and/or IP for maintaining state).
I don't have a clue as how to do this outside of my own efforts (eg, using approaches like the above) and maybe using SSL. Also these are not my servers, but are run by hosting companies who don't like executables being installed - understandably.
(I know this has little to do with PureBasic, save that the website is administered by people using specialist clients written in purebasic, but I am hoping some of you IT gurus or webmasters will humour me anyhow)
Edit: Some editing to reduce verbosite (really!) and deobsfucate this post.





