Forums
This topic is locked
Dynamic Sessin Variable Names....?
Posted 23 Nov 2001 17:04:38
1
has voted
23 Nov 2001 17:04:38 Andrew Watson posted:
Is there a way to do something like this...Session("[VARAIBALE]"
i have my reasons, honest.
<img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>
Leed
Edited by - leed on 26 Nov 2001 03:16:03
Replies
Replied 28 Nov 2001 16:18:13
28 Nov 2001 16:18:13 Joel Martinez replied:
Sure, just use a variable:<pre id=code><font face=courier size=2 id=code>Session(varName)</font id=code></pre id=code>the variable could be something from the querystring, a value from the database, I do this same thing for my authentication system...
each user has one to many "permissions" so when the person logs in, I loop through the recordset and do<pre id=code><font face=courier size=2 id=code>do while not rs.eof
session(rs("permissionName") = true
loop</font id=code></pre id=code>Then I protect pages like this<pre id=code><font face=courier size=2 id=code>if session("admin" <> true then
response.redirect("deny.asp"
end if</font id=code></pre id=code>, that way, I can have any number of permission levels I want...
Joel Martinez [ ]
----------
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/
each user has one to many "permissions" so when the person logs in, I loop through the recordset and do<pre id=code><font face=courier size=2 id=code>do while not rs.eof
session(rs("permissionName") = true
loop</font id=code></pre id=code>Then I protect pages like this<pre id=code><font face=courier size=2 id=code>if session("admin" <> true then
response.redirect("deny.asp"
end if</font id=code></pre id=code>, that way, I can have any number of permission levels I want...
Joel Martinez [ ]
----------
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/