Re: ASP Cookies vs. ASP Session variables

by "Phil Babcock" <pbabcock(at)bgsgroup.com>

 Date:  Thu, 09 Nov 2000 09:24:32 -0500
 To:  "Rasika Wijayaratne" <rasika(at)boursedata.com.au>,
hwg-languages(at)hwg.org
 References:  hotmail Rasika2K felix Rasika2K2
  todo: View Thread, Original
>>Every page then does lngClientID =3D Request.Querystring("id") and in the
>case where lngClientID =3D "" then we check >the cookie and if it is still
>null we get a new one from the database.
>Are you referring to the Primary Key (auto number) in the "users" table,=
 or
>do you mean some kind of randomly asssigned number?
Actually, neither.  It is an auto number field that gets incremented and=
 then we apply a certain algorithm to generate a seemingly random number=
 that is passed to the client.  This way it doesnt appear that the numbers=
 are sequential and also the numbers that the clients see (in the query=
 strings) aren't the actual numbers that are in the database.  Make sense?=
  If you need more information on this I would have to go have a word with=
 the "database guy"...     ;)

>My curent project has scripts that are accessed by admin users and normal
>users.  So I have a session variable that detrmin if a certain block of=
 html
>gets rendered or not, depending on who is viewing the page:-
>if Session(bolIsAdmin) =3D True Then
>    Response.Write <block of HTML>
>end if
>How would you handle this sort of siutation without using Session=
 variables?
>You wouldn't want to pass this sort of info via querystring as a non-admin
>user could feed in values using the broswer address bar, and access things
>they should not.  By using cookies perhaps?  I suppose you could open up=
 the
>"users" table on each script, and check if the current user has admin
>status, but that would be a bit of a hassle...

What conditions do you use to determine the value of Session(bollsAdmin)?=
  Do they login?  Is it IP based? Would it be easier to put these scripts=
 in a different directory or on different pages and make users login to=
 them?  How often do non-Admin types access these pages?  If it is a lot,=
 then you are probably wasting time by analyzing the Session(bollsAdmin)=
 repeatedly and unnecessarily when you could just exclude this code and=
 move it elsewhere.  Depending on how secure you want these scripts, I=
 don't think that cookies would be a very good solution.  Anyone could=
 easily view the values of cookies stored on their machine and alter=
 them...

If you send a bit more info about your setup and what you are trying to do=
 I *MAY* be able to help!  


phil.

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.