Hack search to prevent application rewriting without using session variables

Our company uses an application that was originally ColdFusion + Access, later converted to classic ASP + MS Sql to track tasks / time, called a query system. It is divided into departments, so there is one for MIS, marketing, logistics, etc. The problem arises when (mostly managers) use more than one at a time, while 2 browser windows open. The query system uses session variables, many session variables, the “session” is mentioned 2,300 times in the application. When 2 are open immediately, as you can imagine, this leads to a mixture of all kinds of anomalies from variables.

There is a 3-year MIS request in the system to “fix” this, and 3 developers were working on it, and now it's my turn to take a picture. I was wondering if anyone else had to work on such a project, and if there is any hack to try to mitigate some of the problems. I was thinking maybe something would be called in global.asa to load different things. session variables from the query string. The problem is that all this happens:

If (Session("Application") <> Request("App")) and Request("App") <> "" THEN
  Session("Application") = Request("App")
End If

Looking at the functions in the include files, you will have a function with 4 parameters that refers to 6 different session variables. So you understand that it will be painful.

Has anyone had to do something like this in the past? Any hacks you found useful?

+3
source share
5 answers

( "" ):

  • API ( / include)
  • -, ( - )

- / , ; -)

+2

( -, ) . . , . , , , : (

0

"", , , . , , , .

, - , , cookie App. , . , , - , .

, , , - .;)

, . , -/ .

0

AnonJr

Blockquote Blockquote

, dataloss

0

( ), , - , ... , , /...

Private Const PREFIX As String = "MyPrefix_"
Public Shared Property MyVariable() As String
    Get
        Return HttpContext.Current.Session(String.Concat(PREFIX, "MyVariable"))
    End Get
    Set(ByVal value As String)
        HttpContext.Current.Session(String.Concat(PREFIX, "MyVariable")) = value
    End Set
End Property

,

For Each Item As Object In HttpContext.Current.Session.Contents
    If Not Item.ToString.StartsWith(PREFIX) Then

    End If
Next
0

Source: https://habr.com/ru/post/1699373/


All Articles