Solved

Session retained across browser, IE and Firefox

Posted on 2009-04-14
6
337 Views
Last Modified: 2012-05-06
I am testing my web application from the web server (not locally) on IE7 and Firefox.

I notice that my session variables are retained from one browser to another.

If I set a session ItemId in IE7 and go to the Firefox and refresh the page, it pulls up the itemID I last pulled up in IE7 rather than the one I last pulled up in Firefox and visa versa.

Is that normal? Seems to me that could cause problems. I think I'm saving to the page I'm on, but if I view an ID in IE7, and then go to save a change in Firefox, it will save under the IE7 session itemID rather than the one I was last on in Firefox. Not that my users will be using two browsers at the same time, but still. It just doesn't seem right.

What is going on?

3.5 framework SP1, web server 2008, sql server 2008

thanks.

0
Comment
Question by:Starr Duskk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 15

Expert Comment

by:NazoUK
ID: 24145686
There's no way Browsers should share sessions unless perhaps you are using cookieless sessions?
How are you saving the data in session?
0
 
LVL 2

Author Comment

by:Starr Duskk
ID: 24147596
That's what I thought, there's no way this should be occuring.
I'm not storing sessions as cookies.
 
0
 
LVL 15

Expert Comment

by:NazoUK
ID: 24149418
What code are you using to add things to session?
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 2

Author Comment

by:Starr Duskk
ID: 24150803
I have a project with a class with a module, like so, and properties defined like so:
 
Public Module MySessions

Private _portalId As Integer = 0
Public Property PortalId() As Integer
Get
Return _portalId
End Get
Set(ByVal value As Integer)
_portalId = value
End Set
End Property

End Module
 
0
 
LVL 15

Accepted Solution

by:
NazoUK earned 500 total points
ID: 24151385
Ah well that explains it, you aren't using session at all. A module in vb is shared throughout the whole application. This means when you change a value for one user it changes for all users.
If you want to store something in session you'd need to do something like:

Public Property PortalId() As Integer
Get
If Session("PortalId") IsNot Nothing Then
Return Session("PortalId")
Else
Return 0
End If
End Get
Set(ByVal value As Integer)
Session("portalId") = value
End Set
End Property

If you are doing this in a class or module you may need to reference the Session object via HttpContext.Current.Session
0
 
LVL 2

Author Comment

by:Starr Duskk
ID: 24151602
Thanks!
 
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question