Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2004
    Posts
    202

    Unanswered: 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

  2. #2
    Join Date
    Dec 2004
    Location
    York, PA
    Posts
    95
    Show me how you "think" you are using it

  3. #3
    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

  4. #4
    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?

  5. #5
    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.

  6. #6
    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

  7. #7
    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")

    %>

  8. #8
    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

  9. #9
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    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??

  10. #10
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •