Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session Variables driving me nuts!

Status
Not open for further replies.

bigfoot

Programmer
May 4, 1999
1,779
US
I just found this out:

I have an asp.net web application that saves info in Session("UserName")="Gary"

So the user picks another department and runs another web application and it does a User=Session("UserName")

And IT'S EMPTY!!

Does this mean that one application does not share server variables with another application??? (no smiley for tearing hair out).
 
Unfortunately yes, session variables are application specific only.

It works the same way as on the desktop:
If you have two seperate applications running, they can't share variables held within them (well, maybe you could, but not in any really nice way).

However, there is some workaround you could do:

1. Make the "applications" sub sets of a global site
For instance, if you have a portal application that has many sub applications within it, the session variables can be shared within. Thats what we did with a project I was working on previously: new functionality became new subfolders within the project root.

2. Create interfaces between your applications
For instance, when a user goes to access the other app, does he do it from within the first one? Is there a way to pass a querystring parameter, store a value in a central datasource and have the second app check that source and re-load its own session variables with those values?

hth

D'Arcy
 
Hi D'Arcy. Here is how our Intranet is set up:

I have a main folder called Web
Under that is all of our Departments folders:
Under them are folders with applications running.
Under Sales there may be a fill in form with a database attached.
Under Data Processing there is a datagrid that you can see some other database stuff.
You get the picture.
My Web folder is not an application. Should it be?
And what does this do to the current web that's in asp?

What's a portal? Sorry, I'm new to .NET.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top