Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Session end without global.asa

    I've got a simple but distressing.... the server that I have does not support Global.asa, yes, its a free server.

    Is there possibly a way that I can get around that and find out when the user session ends and when an application starts?

    Anyone?

  • #2
    Regular Coder
    Join Date
    Oct 2004
    Location
    In front of this computer. (Where else?)
    Posts
    442
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm not sure but I don't think there's a way to do that except maybe hard-coding it (This would depend on what you want to do at the beginning or end of the session)
    Last edited by tboss132; 01-25-2005 at 01:49 PM.
    Tomorrow is the first day of the rest of your life... What have you done today?
    Tutorials
    Web: w3schools, htmldog General tips: Hardware, Networking

  • #3
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Hard Coding? Oh dear? I hope there is a simple way

    I have designed a system where there are six users that can sign into the system. When they sign into the system I make record of it in the database, and I was attempting to use the Application variable to store their name so that I can know and show it to the public that that particular user is online.

    Now when the user clicks sign out.... I delete the record in the database and I can modify the Application variable to reflect this change. However, the problem starts if the user does NOT sign out... just say for example exits and does not click sign out.

    That way the session expires. Now when the session expires... the record stays in my database (mind you, the user will have to sign in again because their session ID would be different from the one I stored). But I really would like to have some code that will delete the records when the session expires and do the same modification that I would have done to the application variable when the session ends.

  • #4
    Regular Coder
    Join Date
    Oct 2004
    Location
    In front of this computer. (Where else?)
    Posts
    442
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm sorry i have to confess i can't offer much help here. I've been thinking about it for about 45 minutes now but when i think i got a solution, i notice a flaw. Hope someone reads this thread and helps out cos i'm going to face a similar situation very soon
    Tomorrow is the first day of the rest of your life... What have you done today?
    Tutorials
    Web: w3schools, htmldog General tips: Hardware, Networking

  • #5
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts
    okay..... tboss

    so any takers more?

  • #6
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    errm.. ive never found a case where you actually have to use application variablies...ever

    heres what i would do, you already have most of the database, just put a last page load time in the database, and update it every time a page is loaded for that user. if the last time they loaded the page is under x minutes ago, they are still assumed to be logged in, this number can be set to the same as your session timeout so you can effectively see if their session is still open without using global.asa at all

    errm.. you might understand this.. i can be a little confusing
    Code:
    if logged in
        update their lastLoadDate
    else
        if ip exists already in guests table
            update the lastLoadDate of that ip
        else
            insert their ip and lastLoadDate into guests table
        end if
    end if
    delete all old records in guest table
    if you dont want guests ignore everything after "else"

    then run a sql count(...) from.. where lastLoadDate < x mins ago

    hope that helps, it uses database instead of global.asa

  • #7
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Okay.... thanks for that suggestions....
    I'm currently as we speak tryin to represent those changes in my database...

    Quick question tho: How would I say manipulate the now() function to obtain 30 minutes ago?

  • #8
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    run a datediff in minutes i think

  • #9
    Regular Coder
    Join Date
    Oct 2004
    Location
    In front of this computer. (Where else?)
    Posts
    442
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ghell, thanks man. I'll file this away ASAP.
    Tomorrow is the first day of the rest of your life... What have you done today?
    Tutorials
    Web: w3schools, htmldog General tips: Hardware, Networking

  • #10
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts
    I tried that and it worked!!!! But I just hope it doesn't take 2 much server eergy to do the delete!


  •  

    Posting Permissions

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