PDA

View Full Version : the best way to store a value


scroots
12-01-2002, 08:26 PM
what is the best way to store a value e.g. A255Ftn944 to be accessed by a website while the user is browsing the site. the value is obtained from a database during the logon phase.
what are the pros and cons of using:
a)cookies
b)form in a frame
c)session variable

scroots

whammy
12-02-2002, 02:47 AM
It all depends on what you are trying to do... this is always my first question (unless that has been stated already):

What are you trying to accomplish?

That should ALWAYS be the first thing you explain when asking for help, as well. Don't explain what you're trying to accomplish with code, rather explain what you are trying to accomplish with words, instead - since oftentimes people are not even on the right path regarding what they are trying to do. :D

scroots
12-02-2002, 06:16 PM
i would like to store the value for authentification purposes so a script checks to see if it is a vaild value and lets the user access the page.

the user will login on the site and the value should be accessable while they browse and unacessable when they have left the site.

scroots

whammy
12-02-2002, 11:30 PM
If you don't want to rely on cookies, your only option is really a database (or at the very least a text file on the server), since a session variables in classic ASP rely on cookies.

Of course, you can always let your users know "cookies must be enabled to access the features of the site", etc.

scroots
12-03-2002, 08:37 PM
i have my user details in a database, but you see the thing is i need to check wther a user is logged in, when they login i store a variable(thats why i`m interested to know which ways best) and i then check the variable to see if it matches the database if it does it displays the page.

do you see where i`m coming from?

scroots

whammy
12-12-2002, 04:18 AM
I think you already answered your own question? Since HTTP is stateless you either have to rely on cookies or a database.