Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_discuss thread: Validating session variable


Message #1 by thomasbiju@e... on Wed, 16 Jan 2002 10:12:51

Pls solve my problem.

 

In my initial page I have links to other pages. Also I have a username /  

password text boxes and logon on button in this page.  Users can access 

only a few links if he has not logged in. I am storing username in a 

session variable if the login succeeds.  Now my requirement is, when a 

user clicks the link, without logged on, an alert box to be displayed 

saying that "You have to logon to access these links". And focus goes to 

the username textbox. Otherwise focus to be redirected to new page.

 

Pls help. 

Message #2 by Dragos Tudose <dtudose@y...> on Wed, 16 Jan 2002 12:23:01 -0800 (PST)

case 1

if the access to the next pages are the same for every

users..i mean like...u don't have a manager and a

secretary with different levels of access...u can

forget about keeping a session variable with each user

name.

u then create for the user a session variable type

boolean which u set in session_onStart as false.

then if the user logins succesfully..u set it true.

in each of the next pages..or even on the first

page..on click the links..u test if the session

variable is true or false and act accordingly



case 2

if the users have different levels of access..u can

store an in a sessionlevel variable..and array for

each user with 2 rooms.in the first u put the users

name..and in the second the flag.

then test anytime u need (based on a list of

priorities...like a small number of users..or a larger

list..like a database...)if the user has access for

the page or link he's trying to access





hope it helps..and if it doesn't sorry if i thought wrong



__________________________________________________

Do You Yahoo!?

Send FREE video emails in Yahoo! Mail!

http://promo.yahoo.com/videomail/

Message #3 by thomasbiju@e... on Wed, 23 Jan 2002 12:35:47
Thank you very much for the suggestions.



> case 1

> if the access to the next pages are the same for every

> users..i mean like...u don't have a manager and a

> secretary with different levels of access...u can

> forget about keeping a session variable with each user

> name.

> u then create for the user a session variable type

> boolean which u set in session_onStart as false.

> then if the user logins succesfully..u set it true.

> in each of the next pages..or even on the first

> page..on click the links..u test if the session

> variable is true or false and act accordingly

> 

> case 2

> if the users have different levels of access..u can

> store an in a sessionlevel variable..and array for

> each user with 2 rooms.in the first u put the users

> name..and in the second the flag.

> then test anytime u need (based on a list of

> priorities...like a small number of users..or a larger

> list..like a database...)if the user has access for

> the page or link he's trying to access

> 

> 

> hope it helps..and if it doesn't sorry if i thought wrong

> 

> __________________________________________________

> Do You Yahoo!?

> Send FREE video emails in Yahoo! Mail!

> http://promo.yahoo.com/videomail/


  Return to Index