If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > How to use session.abandon

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-08-04, 22:15
michaelfg81 michaelfg81 is offline
Registered User
 
Join Date: Mar 2004
Posts: 202
How to use session.abandon

Hi,

I got problem using session.abandon in my asp code (web site)
If i sue this code in my logout page..................
it comes out this kind of error.....

Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'session(...)'

Wat should i do?
I just wan to delete watever session i have in the system but somehow i cant.
Please help.
Thanx
Reply With Quote
  #2 (permalink)  
Old 12-09-04, 09:47
White Knight White Knight is offline
Registered User
 
Join Date: Dec 2004
Location: York, PA
Posts: 95
Show me how you "think" you are using it
Reply With Quote
  #3 (permalink)  
Old 12-10-04, 01:10
michaelfg81 michaelfg81 is offline
Registered User
 
Join Date: Mar 2004
Posts: 202
actually i use session in my webpage to indentify user in all the pages whether they are valid user or otherwise.........and this will be done once user start to login into my web page.
So what i need it to abandon that particular session when the user logout or at least delete it.
So how would i use this session.abandon in my web site as it comes out with this kind of error.
Thanx
Reply With Quote
  #4 (permalink)  
Old 12-10-04, 08:24
White Knight White Knight is offline
Registered User
 
Join Date: Dec 2004
Location: York, PA
Posts: 95
Think about what you have just said!!

I use Sessions on ALL of my Web pages

When you "hit" Session.Abandon the Session disappears so you need to account for that on any page your user will go to

When you get to Session.Abandon can you redirect to a Non-sessions page?
Reply With Quote
  #5 (permalink)  
Old 12-10-04, 13:23
Seppuku Seppuku is offline
Useless...
 
Join Date: Jul 2003
Location: SoCal
Posts: 721
How about you post the code of your logout page. There are some page flow and scope issues to keep in mind when dealing with the Abandon method... but we would all be at a better position to answer your question if we saw the code in question.
__________________
That which does not kill me postpones the inevitable.
Reply With Quote
  #6 (permalink)  
Old 12-14-04, 00:42
michaelfg81 michaelfg81 is offline
Registered User
 
Join Date: Mar 2004
Posts: 202
Hi,

Currently my logout code look like this

<%
session("username")="Stranger"
session("user_id")="Stranger"
response.Redirect("../default.asp")

%>

My main aim here is to make sure user wont be able to log back into individual page without going thru Login page as every page in my website is equipe with a checking user status.

I just need to flush every data out from the session.
Thanx for ur attention
Reply With Quote
  #7 (permalink)  
Old 12-14-04, 08:48
White Knight White Knight is offline
Registered User
 
Join Date: Dec 2004
Location: York, PA
Posts: 95
So basically you can replace that with

<%
session.Abandon
response.Redirect("../default.asp")

%>

And on every page right at the top

<% If Session("User_Id") = "" Then
response.Redirect("../default.asp")

%>
Reply With Quote
  #8 (permalink)  
Old 12-14-04, 19:30
michaelfg81 michaelfg81 is offline
Registered User
 
Join Date: Mar 2004
Posts: 202
Thanx for your reply.
It work like should have been but still i still cant overcome my problem yet.hehe
Somehow after i logout and re-enter a certain page using the direct url to that particular page, the session seems to exist as at every page i have checking for the authorization for certain user can enter certain pages only. This particular user still can enter that page eventhough he already log out.
I just wan to overcome security problem like outsiders may enter my website using other people session.
How do i overcome this kind of prob
Thanx
Reply With Quote
  #9 (permalink)  
Old 12-19-04, 19:56
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Okie,... question which may help solve things.....

What happens if you let the session expire naturally,... do you get redirected or can you access the page??
Reply With Quote
  #10 (permalink)  
Old 12-20-04, 02:30
michaelfg81 michaelfg81 is offline
Registered User
 
Join Date: Mar 2004
Posts: 202
actually it should redirect to the login page once the session expired but currently
i set timout for the page to return to login page and delete all session once the time is up.
Once the session expire.............user cant go into the webpage except he
go thru the process of login again.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On