Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > hi, i have some problem with session

Reply
Thread Tools

hi, i have some problem with session

 
 
Mikael Hellström
Guest
Posts: n/a
 
      04-13-2004
Hi,
I have a site with a lot off online users. I have a special frame that show
all logged in members and i update this frame in a minute intervall to
catch any mewly logged in members.

My problem is...i use a session time out set to 20 minutes. But the session
never dies. This must be a side effect off the timer i use.

How can i solve this problem? Any suggestion? I must kill session if the
member leaves without logg out.

Regards Mikael


 
Reply With Quote
 
 
 
 
Steven Burn
Guest
Posts: n/a
 
      04-13-2004
I wrote a function that logged people out after a set period of time (60
mins), but unfortunately, it kept booting everyone after the set period of
time (active or not), so if you manage to find an answer to this, I'd also
welcome it.

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)


Mikael Hellström <(E-Mail Removed)> wrote in message
news:yLWec.89628$(E-Mail Removed)...
> Hi,
> I have a site with a lot off online users. I have a special frame that

show
> all logged in members and i update this frame in a minute intervall to
> catch any mewly logged in members.
>
> My problem is...i use a session time out set to 20 minutes. But the

session
> never dies. This must be a side effect off the timer i use.
>
> How can i solve this problem? Any suggestion? I must kill session if the
> member leaves without logg out.
>
> Regards Mikael
>
>



 
Reply With Quote
 
 
 
 
Ray at
Guest
Posts: n/a
 
      04-13-2004
How are you tracking the list of users logged in? In an application
variable? In a database? Do you have logout functionality? Need more
info. Are you using global.asa with a SEssion_OnEnd to change the flag,
wherever that may be?

Ray at work


"Mikael Hellström" <(E-Mail Removed)> wrote in message
news:yLWec.89628$(E-Mail Removed)...
> Hi,
> I have a site with a lot off online users. I have a special frame that

show
> all logged in members and i update this frame in a minute intervall to
> catch any mewly logged in members.
>
> My problem is...i use a session time out set to 20 minutes. But the

session
> never dies. This must be a side effect off the timer i use.
>
> How can i solve this problem? Any suggestion? I must kill session if the
> member leaves without logg out.
>
> Regards Mikael
>
>



 
Reply With Quote
 
Mikael Hellström
Guest
Posts: n/a
 
      04-13-2004
Hi, more info...
I track the on-line user in a database (sql-server 2000).
When the loggen in user press loggout button i call session.abandon.

In my global.asp i have code in (Session_OnEnd )that delete the user from
the data base.
Before i use the timer the system worked soo fine. When the people fall a
sleep he automatic
where deleted from db.

This system works great for me until i started to use the timer to update my
online list.
The update system with the timer is ruin everything here...

Question. How can i solve this on some way??

Regards Mikael



"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:%(E-Mail Removed)...
> How are you tracking the list of users logged in? In an application
> variable? In a database? Do you have logout functionality? Need more
> info. Are you using global.asa with a SEssion_OnEnd to change the flag,
> wherever that may be?
>
> Ray at work
>
>
> "Mikael Hellström" <(E-Mail Removed)> wrote in message
> news:yLWec.89628$(E-Mail Removed)...
> > Hi,
> > I have a site with a lot off online users. I have a special frame that

> show
> > all logged in members and i update this frame in a minute intervall to
> > catch any mewly logged in members.
> >
> > My problem is...i use a session time out set to 20 minutes. But the

> session
> > never dies. This must be a side effect off the timer i use.
> >
> > How can i solve this problem? Any suggestion? I must kill session if the
> > member leaves without logg out.
> >
> > Regards Mikael
> >
> >

>
>



 
Reply With Quote
 
Ray at
Guest
Posts: n/a
 
      04-13-2004
If you refresh the page every minute, and the person falls asleep, he will
remain logged in. Because, every time that page is refreshed, that
reaffirms his continued session. How can you get around this? You could
not use sessions and just use only your "session" tracking that you're using
in your SQL database. You'd want to keep track of the time of his last
action in the database then so that you can tell when someone should be
logged out automatically. Then have a job that runs in SQL to clear out
"sessions" that haven't been used in over 20 minutes.

Ray at work

"Mikael Hellström" <(E-Mail Removed)> wrote in message
newsbXec.55954$(E-Mail Removed)...
> Hi, more info...
> I track the on-line user in a database (sql-server 2000).
> When the loggen in user press loggout button i call session.abandon.
>
> In my global.asp i have code in (Session_OnEnd )that delete the user from
> the data base.
> Before i use the timer the system worked soo fine. When the people fall a
> sleep he automatic
> where deleted from db.
>
> This system works great for me until i started to use the timer to update

my
> online list.
> The update system with the timer is ruin everything here...
>
> Question. How can i solve this on some way??
>
> Regards Mikael
>
>
>
> "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
> message news:%(E-Mail Removed)...
> > How are you tracking the list of users logged in? In an application
> > variable? In a database? Do you have logout functionality? Need more
> > info. Are you using global.asa with a SEssion_OnEnd to change the flag,
> > wherever that may be?
> >
> > Ray at work
> >
> >
> > "Mikael Hellström" <(E-Mail Removed)> wrote in message
> > news:yLWec.89628$(E-Mail Removed)...
> > > Hi,
> > > I have a site with a lot off online users. I have a special frame that

> > show
> > > all logged in members and i update this frame in a minute intervall to
> > > catch any mewly logged in members.
> > >
> > > My problem is...i use a session time out set to 20 minutes. But the

> > session
> > > never dies. This must be a side effect off the timer i use.
> > >
> > > How can i solve this problem? Any suggestion? I must kill session if

the
> > > member leaves without logg out.
> > >
> > > Regards Mikael
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Mikael Hellström
Guest
Posts: n/a
 
      04-14-2004
Hi,
Could this work?


When the user logged in and every move he takes i set

session("last_move")=now()



Then in the frame with timer i run this code

if timeDiff(session("last_move") , now() )>20 then
session.abandon
end if

Regards mikael




"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:(E-Mail Removed)...
> If you refresh the page every minute, and the person falls asleep, he will
> remain logged in. Because, every time that page is refreshed, that
> reaffirms his continued session. How can you get around this? You could
> not use sessions and just use only your "session" tracking that you're

using
> in your SQL database. You'd want to keep track of the time of his last
> action in the database then so that you can tell when someone should be
> logged out automatically. Then have a job that runs in SQL to clear out
> "sessions" that haven't been used in over 20 minutes.
>
> Ray at work
>
> "Mikael Hellström" <(E-Mail Removed)> wrote in message
> newsbXec.55954$(E-Mail Removed)...
> > Hi, more info...
> > I track the on-line user in a database (sql-server 2000).
> > When the loggen in user press loggout button i call session.abandon.
> >
> > In my global.asp i have code in (Session_OnEnd )that delete the user

from
> > the data base.
> > Before i use the timer the system worked soo fine. When the people fall

a
> > sleep he automatic
> > where deleted from db.
> >
> > This system works great for me until i started to use the timer to

update
> my
> > online list.
> > The update system with the timer is ruin everything here...
> >
> > Question. How can i solve this on some way??
> >
> > Regards Mikael
> >
> >
> >
> > "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
> > message news:%(E-Mail Removed)...
> > > How are you tracking the list of users logged in? In an application
> > > variable? In a database? Do you have logout functionality? Need

more
> > > info. Are you using global.asa with a SEssion_OnEnd to change the

flag,
> > > wherever that may be?
> > >
> > > Ray at work
> > >
> > >
> > > "Mikael Hellström" <(E-Mail Removed)> wrote in message
> > > news:yLWec.89628$(E-Mail Removed)...
> > > > Hi,
> > > > I have a site with a lot off online users. I have a special frame

that
> > > show
> > > > all logged in members and i update this frame in a minute intervall

to
> > > > catch any mewly logged in members.
> > > >
> > > > My problem is...i use a session time out set to 20 minutes. But the
> > > session
> > > > never dies. This must be a side effect off the timer i use.
> > > >
> > > > How can i solve this problem? Any suggestion? I must kill session if

> the
> > > > member leaves without logg out.
> > > >
> > > > Regards Mikael
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Steven Burn
Guest
Posts: n/a
 
      04-14-2004
Use Time() instead of Now()

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)


Mikael Hellström <(E-Mail Removed)> wrote in message
news:Z45fc.89661$(E-Mail Removed)...
> Hi,
> Could this work?
>
>
> When the user logged in and every move he takes i set
>
> session("last_move")=now()
>
>
>
> Then in the frame with timer i run this code
>
> if timeDiff(session("last_move") , now() )>20 then
> session.abandon
> end if
>
> Regards mikael
>
>
>
>
> "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
> message news:(E-Mail Removed)...
> > If you refresh the page every minute, and the person falls asleep, he

will
> > remain logged in. Because, every time that page is refreshed, that
> > reaffirms his continued session. How can you get around this? You

could
> > not use sessions and just use only your "session" tracking that you're

> using
> > in your SQL database. You'd want to keep track of the time of his last
> > action in the database then so that you can tell when someone should be
> > logged out automatically. Then have a job that runs in SQL to clear out
> > "sessions" that haven't been used in over 20 minutes.
> >
> > Ray at work
> >
> > "Mikael Hellström" <(E-Mail Removed)> wrote in message
> > newsbXec.55954$(E-Mail Removed)...
> > > Hi, more info...
> > > I track the on-line user in a database (sql-server 2000).
> > > When the loggen in user press loggout button i call session.abandon.
> > >
> > > In my global.asp i have code in (Session_OnEnd )that delete the user

> from
> > > the data base.
> > > Before i use the timer the system worked soo fine. When the people

fall
> a
> > > sleep he automatic
> > > where deleted from db.
> > >
> > > This system works great for me until i started to use the timer to

> update
> > my
> > > online list.
> > > The update system with the timer is ruin everything here...
> > >
> > > Question. How can i solve this on some way??
> > >
> > > Regards Mikael
> > >
> > >
> > >
> > > "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
> > > message news:%(E-Mail Removed)...
> > > > How are you tracking the list of users logged in? In an application
> > > > variable? In a database? Do you have logout functionality? Need

> more
> > > > info. Are you using global.asa with a SEssion_OnEnd to change the

> flag,
> > > > wherever that may be?
> > > >
> > > > Ray at work
> > > >
> > > >
> > > > "Mikael Hellström" <(E-Mail Removed)> wrote in message
> > > > news:yLWec.89628$(E-Mail Removed)...
> > > > > Hi,
> > > > > I have a site with a lot off online users. I have a special frame

> that
> > > > show
> > > > > all logged in members and i update this frame in a minute

intervall
> to
> > > > > catch any mewly logged in members.
> > > > >
> > > > > My problem is...i use a session time out set to 20 minutes. But

the
> > > > session
> > > > > never dies. This must be a side effect off the timer i use.
> > > > >
> > > > > How can i solve this problem? Any suggestion? I must kill session

if
> > the
> > > > > member leaves without logg out.
> > > > >
> > > > > Regards Mikael
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
PW
Guest
Posts: n/a
 
      04-14-2004


I saw this global.asa example on the web somewhere a long time ago. Its
been working fine for me.

<script language=VBScript runat=Server>
Sub Application_OnStart
Application("active") = 0
End Sub
Sub Application_OnEnd
'---nothing here
End Sub
Sub Session_OnStart
Session.Timeout = 20
'---lock Application variable before updating
Application.Lock
Application("active") = Application("active") + 1
Application.Unlock
End Sub
Sub Session_OnEnd
Application.Lock
Application("active") = Application("active") - 1
Application.Unlock
End Sub
</script>




 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there someone have written some programs about RSA-1024?I have some question. dolphin C++ 3 03-09-2007 02:47 PM
a question: Do I have to have some work experience before taking the exam jessi MCAD 3 04-04-2005 10:04 AM
Forms Authentication question: How to have some pages open and some requiring forms authentication Eric ASP .Net 2 02-13-2004 02:14 PM
Store shell session/cmd.exe session in some object? Zach Dennis Ruby 2 01-08-2004 10:07 PM
Session State - What does it take to establish one single ASP.NET session per "browser session" Jeff Smythe ASP .Net 3 01-02-2004 04:10 AM



Advertisments