Session Variables

Discussion in 'ASP General' started by Johnd, Dec 11, 2003.

  1. Johnd

    Johnd Guest

    Is there a server-side event that fires when the session variable expires
    that i can trap and do something with (ie renew the session Variable or say
    run an asp to update a database)

    John,
     
    Johnd, Dec 11, 2003
    #1
    1. Advertising

  2. Johnd

    Ray at Guest

    There is Session_OnEnd() which you can use in your global.asa file for your
    application, but read here first.
    http://www.aspfaq.com/show.asp?id=2078

    What are you trying to do?

    Ray at work

    "Johnd" <johnjob{a}myway.com> wrote in message
    news:...
    > Is there a server-side event that fires when the session variable expires
    > that i can trap and do something with (ie renew the session Variable or

    say
    > run an asp to update a database)
    >
    > John,
    >
    >
     
    Ray at, Dec 11, 2003
    #2
    1. Advertising

  3. Johnd

    Johnd Guest

    I am trying to control record locking by assigning a field in a table to the
    username when they log in. Then if any other user logs in, they get an
    error that "john is editting this record". I have the locking working the
    way I want, but the unlocking is posing a significant issue. I have added
    the "onunload" event to the page which runs an asp that basically sets the
    field to "" (essentialy unlocking it) however it doesn't seem to fire every
    time. The result is that I get records left locked open. I thought i might
    be able to fire an event on the server when a session variable expires that
    will unlock the associated record.

    Any thoughts?

    John

    Some background info:

    Advantage server for Novell (.dbf files)





    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:O$...
    > There is Session_OnEnd() which you can use in your global.asa file for

    your
    > application, but read here first.
    > http://www.aspfaq.com/show.asp?id=2078
    >
    > What are you trying to do?
    >
    > Ray at work
    >
    > "Johnd" <johnjob{a}myway.com> wrote in message
    > news:...
    > > Is there a server-side event that fires when the session variable

    expires
    > > that i can trap and do something with (ie renew the session Variable or

    > say
    > > run an asp to update a database)
    > >
    > > John,
    > >
    > >

    >
    >
     
    Johnd, Dec 11, 2003
    #3
  4. Johnd

    Ray at Guest

    So, if John loads a page:

    editrecord.asp?recordid=4

    and then Jeff loads that same page, you want Jeff to see "John's editing the
    record."

    You should be able to handle this in Session_OnEnd, but instead, what you
    might consider doing is tracking the time that a user opens the record also.
    So, if John opens the record, stick his name in your column, but also put
    the date and time in there. So, when you load the page and execute your
    query to get that record, if there's a name in the column, but the date and
    time are 45 minutes old, let the new person edit. If it's only a couple
    minutes old, return back that John's editing it.

    I'd maybe try something like that in conjunction with session_onend as well
    as ensuring that the values are deleted when the person submits the changes,
    of course.

    Ray at work

    "Johnd" <johnjob{a}myway.com> wrote in message
    news:...
    > I am trying to control record locking by assigning a field in a table to

    the
    > username when they log in. Then if any other user logs in, they get an
    > error that "john is editting this record". I have the locking working the
    > way I want, but the unlocking is posing a significant issue. I have added
    > the "onunload" event to the page which runs an asp that basically sets the
    > field to "" (essentialy unlocking it) however it doesn't seem to fire

    every
    > time. The result is that I get records left locked open. I thought i

    might
    > be able to fire an event on the server when a session variable expires

    that
    > will unlock the associated record.
    >
    > Any thoughts?
    >
    > John
    >
    > Some background info:
    >
    > Advantage server for Novell (.dbf files)
    >
    >
    >
    >
    >
    > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    > news:O$...
    > > There is Session_OnEnd() which you can use in your global.asa file for

    > your
    > > application, but read here first.
    > > http://www.aspfaq.com/show.asp?id=2078
    > >
    > > What are you trying to do?
    > >
    > > Ray at work
    > >
    > > "Johnd" <johnjob{a}myway.com> wrote in message
    > > news:...
    > > > Is there a server-side event that fires when the session variable

    > expires
    > > > that i can trap and do something with (ie renew the session Variable

    or
    > > say
    > > > run an asp to update a database)
    > > >
    > > > John,
    > > >
    > > >

    > >
    > >

    >
    >
     
    Ray at, Dec 11, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Earl Teigrob

    Global Session Variables and Session State

    Earl Teigrob, Dec 16, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    4,293
    Alvin Bruney
    Dec 17, 2003
  2. =?iso-8859-15?Q?Fabr=EDcio_de_Novaes_Kucinskis?=

    Session Variables assigned to the wrong session?

    =?iso-8859-15?Q?Fabr=EDcio_de_Novaes_Kucinskis?=, Jan 20, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    719
    Alvin Bruney [MVP]
    Jan 20, 2005
  3. Robert Faulkner
    Replies:
    0
    Views:
    889
    Robert Faulkner
    Jan 28, 2005
  4. Replies:
    1
    Views:
    950
  5. Replies:
    9
    Views:
    991
Loading...

Share This Page