How to Get a New Session ID

J

Jamie

Hello,

We are opening Web Forms via a workflow system that our company has
purchased from an outside vendor. Our problem is when opening multiple
pages from the workflow system for the same Web Project (under the
same virtual directory). Each time a page or new browser is opened via
the workflow system, the pages use the same Session object.

Example -
1) Open Page x From workflow system for a sepcific issue
2) Leave first page open and open Page x for a different issue from
the workflow system.

We displayed the Session ID to the page on load of these and they are
using the same session id. This is a huge problem for us as our web
projects utilize session variables a lot.

We have looked into using the Session.Abandoned method but this does
not work as the first page opened looses it session variables when the
Page.Abandoned is called on the second page (as this is abandoning the
session object and both browsers are using the same object).

Is there a way that we can someone force the browser to drop it's
session ID and create a new one when the page is opened? We are
playing with the idea of having a controller page that will create a
new session then redirect to the appropriate page within the project.

Any help/tips/suggestions would be greatly appreciated as we have been
fighting with this for a few days now.

Thanks!
 
C

Craig Deelsnyder

Jamie said:
Hello,

We are opening Web Forms via a workflow system that our company has
purchased from an outside vendor. Our problem is when opening multiple
pages from the workflow system for the same Web Project (under the
same virtual directory). Each time a page or new browser is opened via
the workflow system, the pages use the same Session object.

Example -
1) Open Page x From workflow system for a sepcific issue
2) Leave first page open and open Page x for a different issue from
the workflow system.

We displayed the Session ID to the page on load of these and they are
using the same session id. This is a huge problem for us as our web
projects utilize session variables a lot.

We have looked into using the Session.Abandoned method but this does
not work as the first page opened looses it session variables when the
Page.Abandoned is called on the second page (as this is abandoning the
session object and both browsers are using the same object).

Is there a way that we can someone force the browser to drop it's
session ID and create a new one when the page is opened? We are
playing with the idea of having a controller page that will create a
new session then redirect to the appropriate page within the project.

Any help/tips/suggestions would be greatly appreciated as we have been
fighting with this for a few days now.

Thanks!

May I ask why you need a new ID? Normally you don't care about it, but
are you tracking this in the backend, like doing some of your own
session type work in a DB (logging and using it)? Even though a .NET
session is abandoned, the .NET framework can choose to reuse that same
Session ID again for that client, or another one. It's not uncommon for
a client to have the same Session ID between sessions.

Just FYI...
 
J

Jamie Pompu

Hi Craig, thanks for the reply,

I store values in the session that I later use on different pages to
display/manipulte the pages accordingly. Since there are two different
browsers opening for two different issues, that are using the same
session object (session id), the pages are not rendering correctly. I
also store Datasets in the Session to reduce the amount of hits to the
database but when each browser is opened from our workflow system, I
reload the Dataset in the Pages Bind event.

The only alternative that I have to storing these values in the session
is to pass them in the query string which is not very secure. As some of
these values are used to render the page correctly, it would be easy
enough for Joe User to change the Query String and potentially corrupt
the data.

I don't neccessarly care about the id iteself, I am more wondering if I
can force each browser that is opened for my web project to ensure that
it has a unique session. Each browser that is opening from out Workflow
system is copying the session data already populated in the already open
browser the same as it would if you click File -> New Window from the
original browser.

Thanks,
Jamie

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
T

Trevor Benedict R

If redesigning the Web application is within means then why not use the
ViewState instead of the Session. Then you go by each page rather than
session.

Regards,

Trevor Benedict R
MCSD

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top