in reply to Re^2: Passing flags between invocations of a cgi script
in thread Passing flags between invocations of a cgi script
The thing to keep in mind is that your script is started, deals with a request and then terminates. Nothing should survive except what you have written to disk, and what the user knows.
But you can't trust the user, so don't believe anything they say or the sister of bobby tables will tell you that her name is "admin", authenticated=1 and/or score=1000000 ;)
Instead of real info, only give them a session ID that is really hard to guess (say, 32 random hex characters), and delete session info that is older than 30 minutes. Use the string they reply with to find and load the user's session info (last question/score/login name/etc). If it doesn't exist, send them to the login screen.
Edit: Fixed link
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Passing flags between invocations of a cgi script
by Herbert37 (Novice) on May 17, 2010 at 20:43 UTC | |
by wanna_code_perl (Friar) on May 17, 2010 at 20:51 UTC | |
by chromatic (Archbishop) on May 18, 2010 at 16:18 UTC |