473,815 Members | 4,001 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Session or not

1,000 users log in for entering data.

Which is the best way to clean up after each user? How do I end a
session properly when an explicit logout is not an option?

If the user just closes the browser will my IIS clean up
automatically, or ought I to do something explicit?

If no Session Timeout is set, is the session then infinite?

As you may see, I'm somewhat confused. :-)

Regards /Snedker
Jan 22 '07 #1
6 1264
Which is the best way to clean up after each user? How do I end a
session properly when an explicit logout is not an option?
If you want code to run then add it to the Session_End event in the
global.asax file.
If the user just closes the browser will my IIS clean up
automatically, or ought I to do something explicit?
After the session timeout, IIS will destroy the session for you and call the
Session_End event.
If no Session Timeout is set, is the session then infinite?
No, there is always a timeout. Think it defaults to 20 mins if you don't
change it.
Jan 22 '07 #2
Yep. That about sums it up.

Just a silly point for completion. You can set the Session never to time
out: but that would be a bit daft in my view.

You might also want to ensure that the Session Timeout and any Authorisation
Cookie timeout are set to the same value. By default, one of them is 20
mins, and the other is 10 IIRC, which doesn't make a lot of sense to me.

HTH

Peter

"Aidy" <ai**@noemail.x xxa.comwrote in message
news:eK******** *************@b t.com...
>Which is the best way to clean up after each user? How do I end a
session properly when an explicit logout is not an option?

If you want code to run then add it to the Session_End event in the
global.asax file.
>If the user just closes the browser will my IIS clean up
automaticall y, or ought I to do something explicit?

After the session timeout, IIS will destroy the session for you and call
the Session_End event.
>If no Session Timeout is set, is the session then infinite?

No, there is always a timeout. Think it defaults to 20 mins if you don't
change it.


Jan 22 '07 #3
"Morten Snedker" <morten_spammen ot_ATdbconsult. dkwrote in message
news:ff******** *************** *********@4ax.c om...
If the user just closes the browser will my IIS clean up
automatically, or ought I to do something explicit?
Just to add to what Aidy and Peter have said, your webserver and all its
running software (IIS, ASP.NET etc) has no way of knowing if the user has
closed their browser, or has left your site...

You can try using JavaScript in the window.onunload event of your webpages,
but this is highly unreliable...
Jan 22 '07 #4
its common to want sessions to last days (think of a shopping cart or
wish lists). but authenication should timeout quicker.

note: only the inproc session manager fires the Session_End, which
should not be used for large production sites unless it just used for
caching (can recreate data if session lost).

-- bruce (sqlwork.com)

Peter Bradley wrote:
Yep. That about sums it up.

Just a silly point for completion. You can set the Session never to time
out: but that would be a bit daft in my view.

You might also want to ensure that the Session Timeout and any Authorisation
Cookie timeout are set to the same value. By default, one of them is 20
mins, and the other is 10 IIRC, which doesn't make a lot of sense to me.

HTH

Peter

"Aidy" <ai**@noemail.x xxa.comwrote in message
news:eK******** *************@b t.com...
>>Which is the best way to clean up after each user? How do I end a
session properly when an explicit logout is not an option?
If you want code to run then add it to the Session_End event in the
global.asax file.
>>If the user just closes the browser will my IIS clean up
automatically , or ought I to do something explicit?
After the session timeout, IIS will destroy the session for you and call
the Session_End event.
>>If no Session Timeout is set, is the session then infinite?
No, there is always a timeout. Think it defaults to 20 mins if you don't
change it.


Jan 22 '07 #5
Ah yes. Good point. It just shows how ones mind can run on rails and fail
to see what's on the other tracks.

OK. That's enough for that metaphor, but thanks again for broadening my
horizons. Nice one.
Peter
"bruce barker" <no****@nospam. comwrote in message
news:OY******** ******@TK2MSFTN GP02.phx.gbl...
its common to want sessions to last days (think of a shopping cart or wish
lists). but authenication should timeout quicker.

note: only the inproc session manager fires the Session_End, which should
not be used for large production sites unless it just used for caching
(can recreate data if session lost).

-- bruce (sqlwork.com)

Peter Bradley wrote:
>Yep. That about sums it up.

Just a silly point for completion. You can set the Session never to time
out: but that would be a bit daft in my view.

You might also want to ensure that the Session Timeout and any
Authorisatio n Cookie timeout are set to the same value. By default, one
of them is 20 mins, and the other is 10 IIRC, which doesn't make a lot of
sense to me.

HTH

Peter

"Aidy" <ai**@noemail.x xxa.comwrote in message
news:eK******* **************@ bt.com...
>>>Which is the best way to clean up after each user? How do I end a
session properly when an explicit logout is not an option?
If you want code to run then add it to the Session_End event in the
global.asax file.

If the user just closes the browser will my IIS clean up
automaticall y, or ought I to do something explicit?
After the session timeout, IIS will destroy the session for you and call
the Session_End event.

If no Session Timeout is set, is the session then infinite?
No, there is always a timeout. Think it defaults to 20 mins if you
don't change it.

Jan 22 '07 #6
Yes. The most reliable way, of course, if you're using Forms
Authentication, is to use FormsAuthentica tion.SignOut.

Won't work if someone just closes their browser, of course, but it should
be used anywhere there's any kind of event that can be handled - even if
it's only Session_End.

:)

Peter

"Mark Rae" <ma**@markNOSPA Mrae.comwrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
"Morten Snedker" <morten_spammen ot_ATdbconsult. dkwrote in message
news:ff******** *************** *********@4ax.c om...
>If the user just closes the browser will my IIS clean up
automaticall y, or ought I to do something explicit?

Just to add to what Aidy and Peter have said, your webserver and all its
running software (IIS, ASP.NET etc) has no way of knowing if the user has
closed their browser, or has left your site...

You can try using JavaScript in the window.onunload event of your
webpages, but this is highly unreliable...

Jan 22 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3312
by: Damien | last post by:
Hi to all, I'm currently re-designing our intranet : nice and lean CSS2, cleaned-up PHP 4.3.7, better-normalized MySQL ;o). So I've started using the $_SESSION variable instead of register_globals and a couple "better pratice" code. Not perfect, but better. Problem : I'm testing everything with Firefox on my machine (IIS on WinXP Pro), and everything is ok. As soon as I try MS IE 6, it doesn't seem to keep the sessions from page to...
1
4377
by: mudge | last post by:
I'm running PHP Version 4.3.10. I'm trying to make it so that when a person logs in using a user name and password that their session is valid and continues for a few months so they don't have to log in each time they come to the site. In a .htaccess file I set session.cookie_lifetime to 20736000 seconds and I set session.gc_maxlifetime to 20736000 It works for about 30 minutes. A user can login and then close their browser and then...
6
2394
by: Al Jones | last post by:
This is a repost form the vbscript newgroup - if this isn't the appropriate group would you point me toward one that is. Basically, I seem to be losing session data part way though preparing an email from (possibly) three seperate forms. the following code is the end of a routine which stashes data from the first form off to session variables and then redirects itself to the proper form / procedure depending upon the state of two...
5
2462
by: Abhilash.k.m | last post by:
This is regarding the session management using Out of proc session management(SQL SERVER). Among the samples below which one is better to set the session? 1. There are 20 session variables and all of them are being stored into session and accessed from session and individual session object. Example: Session = "XYZ", Session=100, Session="NAME", etc.
0
3242
by: joseph conrad | last post by:
Hi, I tried to implement my own session handler in order to keep control on the process the drawback I foun it is not creating and storing in my cookie the PHPSESSID variable anymore. reading te documentation it seems it should do it anyway any advice?
14
2385
by: aroraamit81 | last post by:
Hi, I am facing a trouble. I have some Session variables in my code and somehow my session variables are getting mixed up with other users. For example User A has access to 10 companies and User B has access to 5, now when both of us hits to the server at the same time then their session variables gets mixedup means either User A and USer B will have now 5 companies or both have 10 companies. Now again when User A hits to the server...
7
3972
by: aroraamit81 | last post by:
Well Guys, Here is a very strange trouble. When more than one users request tto same page at the same time then our session gets conflicted. Moreover I printed my SessionID, strangely but true I got the exact same SessionID as of other users's. Well I guess nothing wrong with my code, do I need to set any property in Web.Config file??
0
2484
by: TRB_NV | last post by:
I'd been using an Access database based shopping cart, but wanted to change it so that it would use session variables. I have a form that's submitted to a page called addtocart.asp that contains the following information: intProdID -- ProductID strProdName -- Product Name intQuant -- Quantity intProdPrice -- Price productType -- Type of product (ie. Wine, Cheese, etc...)
1
2607
by: Santosh | last post by:
Dear All i am writting a code sending mail with attachement. i am writting code for sending mail in one page and code for attaching a file in the next page. aftet attaching a file i am taking name of that file from attaching file page to email page through in session file .i am giving a facility of attaching five files to user . and i am taking names of both files in session variables but user attach less than five five
5
2442
by: lyealain | last post by:
<% If Session("username") = "" Then Response.Redirect("/CLS/Login.asp") End If Dim conn Dim connectstr Dim db_name, db_username, db_userpassword Dim db_server Dim res
0
9610
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10670
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10408
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10142
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7686
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5708
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3886
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.