Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2007

Tip: Looking for answers? Try searching our database.

What Event Occurs When Someone Leaves Your Web Site?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ross Culver - 14 Jun 2007 21:15 GMT
I need to ensure that session variables are removed whenever someone leaves
my web site.  My understanding is that this should be happening
automatically with the session mode set to InProc.  But it's not.  Every
machine I'm testing this on does the same thing, but then again, everyone is
using Internet Explorer 7.0 with multiple tabs active.

Also, this problem just popped up, probably due to a change I've made, but I
don't have a clue what that might have been.

Thanks.

Ross
Steve C. Orr [MCSD, MVP, CSM, ASP Insider] - 14 Jun 2007 21:48 GMT
I concur with Juan and Mark.  Due to the stateless nature of the web,
session timeout is the most reliable way to determine somebody has left your
site.

Signature

I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net

>I need to ensure that session variables are removed whenever someone leaves
> my web site.  My understanding is that this should be happening
[quoted text clipped - 10 lines]
>
> Ross
Alexey Smirnov - 14 Jun 2007 22:10 GMT
> So when does the page.dispose event take place?  I'd like to call the
> session.abandon, but I don't know when.  I can't call it in the page.unload
> since that defeats the purpose of having it in the first place.  If I
> understand you correctly, you're saying that the only way to clear the
> session variables under the conditions I've describe is with the session
> timeout, correct?

Disposed is the last event on the page occured when a it is released
from memory.

If you call Session.Abandon within the page then the session will be
closed even user doesn't leave your site. So, it doesn't help you.

> I need to ensure that session variables are removed whenever someone leaves
> my web site.  

Why do you need to remove it like that?

Just make a timeout as it is already suggested, and expired session
will be removed automatically.
Ross Culver - 14 Jun 2007 22:43 GMT
The only reason this is an issue is because I have a gridview that populates
as a result of a user search.  The testing team has commented that if they
perform a search, then navigate to some other site and then type the search
page url back into the address line, the result set previously presented
comes up instead of the default view (I have the gridview on a multiview
component).  They want the default page to be presented instead of the
gridview.  Before you ask, there's a reason why the page is coded to
recreate the grid results upon returning to the page due to the fact that a
user can make a selection from the grid, be directed to a new page and then
return back to the same grid result to continue their search.

Any way, while this is less than perfect, it's certainly not a deal breaker.

Thanks to all for you comments and info.

Ross

>> So when does the page.dispose event take place?  I'd like to call the
>> session.abandon, but I don't know when.  I can't call it in the
[quoted text clipped - 18 lines]
> Just make a timeout as it is already suggested, and expired session
> will be removed automatically.
Alexey Smirnov - 15 Jun 2007 08:24 GMT
> The only reason this is an issue is because I have a gridview that populates
> as a result of a user search.  The testing team has commented that if they
[quoted text clipped - 6 lines]
> user can make a selection from the grid, be directed to a new page and then
> return back to the same grid result to continue their search.

What I can suggest here is to use a postback to navigate users between
the pages

if (Page.IsPostBack) {
recreate_grid_results();
}
// else do nothing (default view)

It would help to avoid this:

> perform a search, then navigate to some other site and then type the search
> page url back into the address line, the result set previously presented
> comes up instead of the default view

So, instead of simple hyperlinks use the LinkButton Control

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.