Solved

Session retained across browser, IE and Firefox

Posted on 2009-04-14
6
325 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:BobCSD
  • 3
  • 3
6 Comments
 
LVL 15

Expert Comment

by:NazoUK
Comment Utility
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 1

Author Comment

by:BobCSD
Comment Utility
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
Comment Utility
What code are you using to add things to session?
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 1

Author Comment

by:BobCSD
Comment Utility
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
Comment Utility
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 1

Author Comment

by:BobCSD
Comment Utility
Thanks!
 
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now