Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: session.abandon related problem!!!


Message #1 by "taherm@f... on Mon, 15 Oct 2001 09:39:52
Scenario

i have deisgend a website of 5 pages fully based on session. on the 5th 

page i have closed the session object by writing <% session.abandon %> on 

the very first line of this page.



What i want to do is to place a check on all other 4 pages to see if teh 

session is expired , if not then the user is allowed to access the page 

otherwise the user is diverted to another page .



for that i wrote the below code on all 4 pages



if session.abandon=true then 

response.redirect "sessionexp.asp"

end if



The above code is wrong because session.abandon is a method and so 

generates the error.. then how can i check that is the session is expire 

or not???





plz let me know of how to check if the session is expired or not...



Thanks in advance...



Message #2 by "Hema R." <hema.r@s...> on Mon, 15 Oct 2001 14:17:21 +0530
HI,

You must be having a user id or some sort of unique id  for

every user who logs into

your website.

So u check if Session("userid")="". in every page

If null then redirect back to home page or login page.

This gets executed even if person had successfully logged in and session

expired.

Also on logout..etc..explicit ending of session by using abandon method

causes session("userid") to become null

and hence automatically redirects to login page.



> -----Original Message-----

> From:	taherm@f... [SMTP:taherm@f...]

> Sent:	Monday, October 15, 2001 3:10 PM

> To:	ASP Web HowTo

> Subject:	[asp_web_howto] session.abandon related problem!!!

> 

> Scenario

> i have deisgend a website of 5 pages fully based on session. on the 5th 

> page i have closed the session object by writing <% session.abandon %> on 

> the very first line of this page.

> 

> What i want to do is to place a check on all other 4 pages to see if teh 

> session is expired , if not then the user is allowed to access the page 

> otherwise the user is diverted to another page .

> 

> for that i wrote the below code on all 4 pages

> 

> if session.abandon=true then 

> response.redirect "sessionexp.asp"

> end if

> 

> The above code is wrong because session.abandon is a method and so 

> generates the error.. then how can i check that is the session is expire 

> or not???

> 

> 

> plz let me know of how to check if the session is expired or not...

> 

> Thanks in advance...
Message #3 by "Enzo Zaragoza" <enzaux@g...> on Mon, 15 Oct 2001 20:50:24 +0800
As to what I know, When you use Session.Abandon all your session variable

are reset but you can still use it on the current page but as long as you

leave the page all session variables will not be available anymore.  So the

previous pages I think will expire.  I dont know if I'm correct, this is

just how I see the problem.



Enzo

----- Original Message -----

From: taherm@f...

To: ASP Web HowTo

Sent: Monday, October 15, 2001 9:39 AM

Subject: [asp_web_howto] session.abandon related problem!!!





Scenario

i have deisgend a website of 5 pages fully based on session. on the 5th

page i have closed the session object by writing <% session.abandon %> on

the very first line of this page.



What i want to do is to place a check on all other 4 pages to see if teh

session is expired , if not then the user is allowed to access the page

otherwise the user is diverted to another page .



for that i wrote the below code on all 4 pages



if session.abandon=true then

response.redirect "sessionexp.asp"

end if



The above code is wrong because session.abandon is a method and so

generates the error.. then how can i check that is the session is expire

or not???





plz let me know of how to check if the session is expired or not...



Thanks in advance...

  Return to Index