Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Close User Session

Reply
Thread Tools

Close User Session

 
 
Laurahn
Guest
Posts: n/a
 
      03-14-2007
How can i configure my application for closing the session ? How can i use
the session end for closing the session ?


 
Reply With Quote
 
 
 
 
Mark Fitzpatrick
Guest
Posts: n/a
 
      03-14-2007
Session end is only the event fired when a session is ended. To end the
user's session you would use Session.Abandon() I believe. It will
automatically close the session after 20 minutes of inactivity anyways, and
unload the application itself after the last session is closed.


--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Laurahn" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> How can i configure my application for closing the session ? How can i use
> the session end for closing the session ?
>



 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      03-14-2007
On Mar 14, 11:17 pm, "Laurahn" <(E-Mail Removed)> wrote:
> How can i configure my application for closing the session ? How can i use
> the session end for closing the session ?


Configure a timeout or call Session.Abandon()

 
Reply With Quote
 
Laurahn
Guest
Posts: n/a
 
      03-14-2007
Thanks Mark.

But, i want to know what code I have to put into my app for that hapends.

Can i use a button?

i've read about put some code on Global.asax


 
Reply With Quote
 
Laurahn
Guest
Posts: n/a
 
      03-14-2007
How i Configure a timeout?

Where have I to call Session.Abandon()?


 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      03-14-2007
"Laurahn" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> But, i want to know what code I have to put into my app for that hapends.
>
> Can i use a button?
>
> i've read about put some code on Global.asax


In Global.asax, you have an event called Session_End - this is the event
which fires (so long as your Session is InProc) when the Session ends.

Under normal circumstances, the Session ends for two reasons:

1) it has timed out automatically, by default after 20 minutes of
inactivity, though this figure can be changed

2) it has been ended explicitly ("torn down", to use the jargon)

You may be familiar with logging out of your on-line banking application by
clicking a "Logout" button or whatever - it is the code behind such a button
where you would place the Session.Abandon() code.


 
Reply With Quote
 
Scott M.
Guest
Posts: n/a
 
      03-15-2007
Make a button on your web page. Give it text of "Log out". In its
server-side click event handler, simply write: Session.Abandon()

And/Or in your Web.Config file, find the section that is already there about
the session timeout and change the time from 20 minutes to something else.



"Laurahn" <(E-Mail Removed)> wrote in message
news:u$e%(E-Mail Removed)...
> How i Configure a timeout?
>
> Where have I to call Session.Abandon()?
>
>



 
Reply With Quote
 
Scott M.
Guest
Posts: n/a
 
      03-15-2007
You response doesn't really address the question. The Session_End event
handler is of no use when you are trying to end the session, only after (or
as) the session has ended.

I have been working with sessions for many, many years and you are the first
person to use the "torn down" jargon you speak of that I've ever heard.
It's not a good idea to introduce jargon that is not widely used.


"Mark Rae" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Laurahn" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>> But, i want to know what code I have to put into my app for that hapends.
>>
>> Can i use a button?
>>
>> i've read about put some code on Global.asax

>
> In Global.asax, you have an event called Session_End - this is the event
> which fires (so long as your Session is InProc) when the Session ends.
>
> Under normal circumstances, the Session ends for two reasons:
>
> 1) it has timed out automatically, by default after 20 minutes of
> inactivity, though this figure can be changed
>
> 2) it has been ended explicitly ("torn down", to use the jargon)
>
> You may be familiar with logging out of your on-line banking application
> by clicking a "Logout" button or whatever - it is the code behind such a
> button where you would place the Session.Abandon() code.
>



 
Reply With Quote
 
Scott M.
Guest
Posts: n/a
 
      03-15-2007
I don't believe the application is unloaded after the last session is
unloaded. I belive the application sits idle until it crashes or is taken
off-line, but I don't believe it just ends itself.


"Mark Fitzpatrick" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Session end is only the event fired when a session is ended. To end the
> user's session you would use Session.Abandon() I believe. It will
> automatically close the session after 20 minutes of inactivity anyways,
> and unload the application itself after the last session is closed.
>
>
> --
> Hope this helps,
> Mark Fitzpatrick
> Former Microsoft FrontPage MVP 199?-2006
>
> "Laurahn" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> How can i configure my application for closing the session ? How can i
>> use the session end for closing the session ?
>>

>
>



 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      03-15-2007
"Scott M." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> Make a button on your web page. Give it text of "Log out". In its
> server-side click event handler, simply write: Session.Abandon()


Wish I'd thought of that...


 
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
How to close a TCP socket? (TCPSocket#close doesn't close it) IƱaki Baz Castillo Ruby 7 01-12-2010 01:32 PM
this.Connection.Close(); does not close the Oracle session! Pleasehelp! S_K ASP .Net 6 12-07-2007 02:07 PM
Why does JdbcRowSetImpl.close() close the database connection? Paul van Rossem Java 0 04-07-2005 07:01 PM
JavaMail POP3 folder.close() method close also store! Daniel Albisser Java 1 04-07-2004 03:45 PM
How to close child browser while parent close? Denon ASP .Net 1 11-14-2003 08:14 AM



Advertisments