session state advice

  • Thread starter Thread starter Elliot M. Rodriguez
  • Start date Start date
E

Elliot M. Rodriguez

I am seeking some advice on an issue I am facing concerning session state.

I have an app that relies on 2 session values being set at the start. These
session values set the stage for data that is pulled from the remaining
pages of the app.

At one stage, a user enters data that will change one of these 2 values.
Here is where the problem lies.

At this stage, when the data is changed, a new browser window will open,
starting the user a few screens back. That works fine. The problem is with
the opening browser. Since the session data has changed, the browser that
caused a new window to open loses its previous value. So if the user
continues in the first window, they get the data related to the new browser
window.

I need the 2 to work concurrently, so the user can finish what they were
doing in the original window, yet proceed with processing in the new window.

Any thoughts on how can I accomplish this?

Thank you all for your replies.
 
What do you mean by "The problem is with
the opening browser. Since the session data has changed, the browser that
caused a new window to open loses its previous value."

Looses what value? Why does the session change cause a
loss of value? It might help if you give a specific
example.
 
Jon:

Thanks for your reply.

Imagine this:

- user searches and returns data. 2 session variables are set when they
select a recordset from a datagrid. when they choose the record, they
continue working through the application, reviewing other information
associated with the recordset they selected.
Session("accountID") = 12345
Session("planID") = 67890

- user reaches a page where they can change the planID, and they change it
to 09876. when this occurs, a new browser window opens, starting them from
the page that is served after they selected the record to begin with. this
changing of the planID should change the session variable to
session("planID") = 09876, but the other window behind this new window needs
to stay open, and the user should finish working on the remaining pages
associated with planID 67890.

where the problem comes up is when I change session("planID") to 09876, it
changes it within the scope of the user session, so when the user tries to
finish the original record with the first planID (67890), it instead loads
up 09876. I need it to keep both.

I have managed a hack with querystrings. But I know theres got to be a
better way to do this. I'm sorry if it still sounds convoluted.
 
This behaviour is exactly what Session should do. It has "session" scope
which can be
shared by multiple browser windows.
Cookies are out for a similar reason (or even the same reason: session is
controlled by
cookies, which can be shared between browser windows).

The querystring is a good place to stick values that should be different for
concurrent
windows. Maybe you can also use ViewState, but then you are limited to a
single
series of postbacks and it might be difficult to start the new window with
the correct
page/viewstate combination.

Hans Kesting
 
Thanks Hans. I knew that was the Session's expected behavior, but I was
hoping someone managed an effective "workaround" (read = hack) for similar
situations. I think the querystrings will work out nicely.

;)
 
Back
Top