DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2006
    Posts
    33

    Session variables stay when Firefox is closed, but not in IE

    When I close my IE 6 browser and re-open and navigate to my ASP.Net website all of my session variables are null.
    In Firefox 2 when I close the browser and re-open and navigate to my ASP.Net website all of the previous session variables are still there.

    I want the session variables to be cleared when the user closes their Firefox 2 browser. The default options in Firefox 2 do not have this occur. Is there a way via code or web.config to make sure that these sessions variables (cookies on the client-side) get cleared whenever the browser is closed?

  2. #2
    Join Date
    Apr 2004
    Location
    New York City
    Posts
    538
    Not tested, but you could try clearing them in the Session_End() event in Global.asax.

    You may have to add Global.asax to your app- it's one of the options when you add a new item to your web app.

    Simply add code like

    Session("Name of session variable") = ""

    If it's a string...


    HTH,

    -Andrew

  3. #3
    Join Date
    Jan 2006
    Posts
    33
    The problem actually appears to be that if you have multiple Firefox windows open it won't clear the cookies until every window is closed. In IE it will clear the cookies for an individual browser window when it is closed.

    I still need to find a workaround though :-/

  4. #4
    Join Date
    Apr 2004
    Location
    New York City
    Posts
    538
    I don't believe this behavior is specified in the standards, so the browser is free to handle it either way...

    So it seems IE considers one window to be a session, whereas FireFox considers all open windows to be a session. Have you tried testing with Opera to see what it does?

    And are those other FireFox windows open to a URL on your website, maybe through a popup window, or to random other sites? Did those windows ever have your site open in them during their lifetime? Or were they separate launches of the Firefox .EXE?

    -Andrew

  5. #5
    Join Date
    Dec 2003
    Posts
    2,750
    I'm a little confused by your description. Are you referring to cookies (client-side) or session variables (server-side)?
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

Similar Threads

  1. Use Session variables in Global.aspx
    By kero in forum ASP.NET
    Replies: 9
    Last Post: 09-19-2005, 08:54 AM
  2. releasing session variables
    By Matt Markus in forum ASP.NET
    Replies: 3
    Last Post: 06-16-2003, 05:48 PM
  3. All Session Variables
    By Pierre in forum ASP.NET
    Replies: 0
    Last Post: 03-28-2002, 12:32 PM
  4. passing Session variables in Form
    By Bill Heffner in forum ASP.NET
    Replies: 0
    Last Post: 11-13-2001, 05:34 PM
  5. Lose of Session variables
    By Yang Du in forum ASP.NET
    Replies: 2
    Last Post: 10-26-2001, 10:14 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links