PDA

View Full Version : session ID


scroots
12-10-2002, 06:58 PM
can i chnage the session ID to anything i like using a script, for example is it possible to set the session ID to bloggsj?
when does a session expire?
scroots

glenngv
12-11-2002, 01:59 AM
I think SessionID is just readonly.
Session timeout by default is 20 mins. But you can set it during runtime by:
Session.Timeout = 30 'in minutes

for more details of the session object, pls see the link below:
http://www.devguru.com/Technologies/asp/quickref/session.html

whammy
12-12-2002, 12:09 AM
I wouldn't depend on the sessionID for anything, since it is not necessarily unique. What are you trying to accomplish? :D

scroots
12-13-2002, 07:54 PM
i want to set the session ID after logging into my site so i can check wheter a usr is allowed to access pages or not.


scroots

whammy
12-13-2002, 08:52 PM
Why don't you just use a session variable? i.e.

Session("allowedviewing") = "Unlimited"

or something...

scroots
12-14-2002, 10:44 AM
whammy do you have any more info on session variable as that might be the way forward.

scroots

whammy
12-14-2002, 11:16 AM
http://www.w3schools.com/asp/asp_sessions.asp

angiras
12-14-2002, 12:51 PM
you can have an enum

public Enum Allow as byte
no
yes
maybe
End Enum

and in you global.asax

session("allow") = Allow.maybe as default value

then depending on your parameters


you rewrite tes session

session("allow") = Allow.yes

and a general sub for your pages

public shared sub IsAllowed ()

select case (ctype(session("Allow"), Allow)

case Allow.maybe

response.redirect ("login.aspx")

case Allow.yes

show all

case Allow.no

show limited

end select

end sub

angiras
12-14-2002, 12:52 PM
as default value
is just a commentar

scroots
12-14-2002, 12:53 PM
thank you whammy

scroots