Session variables are accessible to multiple users?

I have an asp.net website in which users can submit reports. Another tester and I tested this page at the same time and when I went to review the information I submitted, it displayed information that I didn’t submit. It displayed the info submitted from the other user.

I use session variables for these values. I don’t understand how this happened?

What can I do so each user can individually submit their information without overlapping some one else’s information? The plan is for multiple users to be able to use this page to submit their weekly layer reports.

The first example of code is how I add the session variables from the textboxes.

If Session("BarnNo") = Nothing Then
                                'add session variables
                                    Session.Add("FName", FNameTextbox.Text)
                                    Session.Add("LName", LNameTextbox.Text)
                                    Session.Add("WkEnd", Calendar1.SelectedDate.ToShortDateString())
                                    Session.Add("DisplayDate", Calendar1.SelectedDate.ToLongDateString)

                                    Session.Add("BarnNo", BarnNumberTextbox.Text)
                                    Session.Add("FlockNo", FlockNoTextbox.Text)
                                    Session.Add("HensSW", Hens)
                                    Session.Add("WkMort", WkM)
                                    Session.Add("SunEggs", Su)
                                    Session.Add("MonEggs", Mo)
                                    Session.Add("TueEggs", Tu)
                                    Session.Add("WedEggs", We)
                                    Session.Add("ThrEggs", Th)
                                    Session.Add("FriEggs", Fr)
                                    Session.Add("SatEggs", Sa)
                                    Session.Add("TtlEggs", TtlEggCount)

                                    If FeedDateTextbox.Text <> "" Or FeedFormTextbox.Text <> "" Or FeedQtyTextbox.Text <> "" Then
                                        Session.Add("FeedDate", FeedDateTextbox.Text)
                                        Session.Add("FeedForm", FeedFormTextbox.Text)
                                        Session.Add("FeedQty", FQ)
                                    End If

                                    If FeedDateBTextbox.Text <> "" Or FeedFormBTextbox.Text <> "" Or FeedQtyBTextbox.Text <> "" Then
                                        Session.Add("FeedDateB", FeedDateBTextbox.Text)
                                        Session.Add("FeedFormB", FeedFormBTextbox.Text)
                                        Session.Add("FeedQtyB", FQB)
                                    End If

                                    If FeedDateCTextbox.Text <> "" Or FeedFormCTextbox.Text <> "" Or FeedQtyCTextbox.Text <> "" Then
                                        Session.Add("FeedDateC", FeedDateCTextbox.Text)
                                        Session.Add("FeedFormC", FeedFormCTextbox.Text)
                                        Session.Add("FeedQtyC", FQC)
                                    End If

                                    If FeedDateDTextbox.Text <> "" Or FeedFormDTextbox.Text <> "" Or FeedQtyDTextbox.Text <> "" Then
                                        Session.Add("FeedDateD", FeedDateDTextbox.Text)
                                        Session.Add("FeedFormD", FeedFormDTextbox.Text)
                                        Session.Add("FeedQtyD", FQD)
                                    End If

                                    If FeedDateETextbox.Text <> "" Or FeedFormETextbox.Text <> "" Or FeedQtyETextbox.Text <> "" Then
                                        Session.Add("FeedDateE", FeedDateETextbox.Text)
                                        Session.Add("FeedFormE", FeedFormETextbox.Text)
                                        Session.Add("FeedQtyE", FQE)
                                    End If

                                    If FeedDateFTextbox.Text <> "" Or FeedFormFTextbox.Text <> "" Or FeedQtyFTextbox.Text <> "" Then
                                        Session.Add("FeedDateF", FeedDateFTextbox.Text)
                                        Session.Add("FeedFormF", FeedFormFTextbox.Text)
                                        Session.Add("FeedQtyF", FQF)
                                    End If

                                    If FeedDateGTextbox.Text <> "" Or FeedFormGTextbox.Text <> "" Or FeedQtyGTextbox.Text <> "" Then
                                        Session.Add("FeedDateG", FeedDateGTextbox.Text)
                                        Session.Add("FeedFormG", FeedFormGTextbox.Text)
                                        Session.Add("FeedQtyG", FQG)
                                    End If

                                    Session.Add("SFIn", SFIn)
                                    Session.Add("Avt", Avt)
                                    If CND <> 0.0 Then
                                        Session.Add("CND", CND)
                                    Else
                                        Session.Add("CNI", CNI)
                                    End If
                                    Session.Add("CCI", CCI)
                                    Session.Add("wgw", wgw)
                                Session.Add("Comments", CommentsTextbox.Text)
                            End If

 

The second one is how I display them in labels on a confirmation page.

'1st project
            BarnNumberLabel.Text = Session("BarnNo").ToString
            FlockNoLabel.Text = Session("FlockNo").ToString
            HensLabel.Text = Session("HensSW").ToString
            WkMortLabel.Text = Session("WkMort").ToString
            SunEggsLabel.Text = Session("SunEggs").ToString
            MonEggsLabel.Text = Session("MonEggs").ToString
            TueEggsLabel.Text = Session("TueEggs").ToString
            WedEggsLabel.Text = Session("WedEggs").ToString
            ThrEggsLabel.Text = Session("ThrEggs").ToString
            FriEggsLabel.Text = Session("FriEggs").ToString
            SatEggsLabel.Text = Session("SatEggs").ToString
            TtlEggsLabel.Text = Session("TtlEggs").ToString

            FeedDateLabel.Text = Session("FeedDate").ToString
            FeedFormLabel.Text = Session("FeedForm").ToString
            FeedQtyLabel.Text = Session("FeedQty").ToString

            If Session("FeedDateB") <> Nothing Or Session("FeedFormB") <> Nothing Or Session("FeedQtyB") <> 0 Or Session("FeedQtyB") <> 0.0 Then
                FDB.Visible = True
                space.Visible = True
                FeedDateBLabel.Text = Session("FeedDateB").ToString
                FeedFormBLabel.Text = Session("FeedFormB").ToString
                FeedQtyBLabel.Text = Session("FeedQtyB").ToString

                spaceB.Visible = True
            End If

            If Session("FeedDateC") <> Nothing Or Session("FeedFormC") <> Nothing Or Session("FeedQtyC") <> 0 Or Session("FeedQtyC") <> 0.0 Then
                FDC.Visible = True
                FeedDateCLabel.Text = Session("FeedDateC").ToString
                FeedFormCLabel.Text = Session("FeedFormC").ToString
                FeedQtyCLabel.Text = Session("FeedQtyC").ToString

                spaceC.Visible = True
            End If

            If Session("FeedDateD") <> Nothing Or Session("FeedFormD") <> Nothing Or Session("FeedQtyD") <> 0 Or Session("FeedQtyD") <> 0.0 Then
                FDD.Visible = True
                FeedDateDLabel.Text = Session("FeedDateD").ToString
                FeedFormDLabel.Text = Session("FeedFormD").ToString
                FeedQtyDLabel.Text = Session("FeedQtyD").ToString

                spaceD.Visible = True
            End If

            If Session("FeedDateE") <> Nothing Or Session("FeedFormE") <> Nothing Or Session("FeedQtyE") <> 0 Or Session("FeedQtyE") <> 0.0 Then
                FDE.Visible = True
                FeedDateELabel.Text = Session("FeedDateE").ToString
                FeedFormELabel.Text = Session("FeedFormE").ToString
                FeedQtyELabel.Text = Session("FeedQtyE").ToString

                spaceE.Visible = True
            End If

            If Session("FeedDateF") <> Nothing Or Session("FeedFormF") <> Nothing Or Session("FeedQtyF") <> 0 Or Session("FeedQtyF") <> 0.0 Then
                FDF.Visible = True
                FeedDateFLabel.Text = Session("FeedDateF").ToString
                FeedFormFLabel.Text = Session("FeedFormF").ToString
                FeedQtyFLabel.Text = Session("FeedQtyF").ToString

                spaceF.Visible = True
            End If

            If Session("FeedDateG") <> Nothing Or Session("FeedFormG") <> Nothing Or Session("FeedQtyG") <> 0 Or Session("FeedQtyG") <> 0.0 Then
                FDG.Visible = True
                FeedDateGLabel.Text = Session("FeedDateG").ToString
                FeedFormGLabel.Text = Session("FeedFormG").ToString
                FeedQtyGLabel.Text = Session("FeedQtyG").ToString
            End If

            SatEndFdInvLabel.Text = Session("SFIn").ToString
            AvgTempLabel.Text = Session("Avt").ToString
            If Session("CND") <> 0.0 Then
                CaseNoLabel.Text = Session("CND").ToString
            ElseIf Session("CNI") <> 0 Then
                CaseNoLabel.Text = Session("CNI").ToString
            Else
                CaseNoLabel.Visible = False
            End If

            CaseCoolLabel.Text = Session("CCI").ToString
            WtrGalWkLabel.Text = Session("wgw").ToString
            CommentsLabel.Text = Session("Comments").ToString
        End If

 

Hi,can you please tell me what is youe session  state?It is inproc or anything else

I’m not sure what you’re asking. I add these session  variables whenever the user  clicks an “Add” button. 

Can anyone else give me a possible explanation to this problem?