views:

429

answers:

4

I am having 2 applications Suppose A and B. I am having a webpage in Application A where i am Setting the Session and in Application B i want to retrieve that session.How can i do that with out using DB?

+5  A: 

Sessions are application specific and I don't believe you can share data between two applications via the session. You will need to pass the data through some other medium. You could serialize it and pass it via a POST parameter. You may also be able to use a cookie. If it is really small data, you could just pass it in the GET parameters of the query string.

NYSystemsAnalyst
A: 

I agree with NYSystemsAnalyst - and here's a FAQ on how to transfer session from a classic ASP app to ASP.NET. The code can nearly be copied to do the same thing in this case.

http://www.tek-tips.com/faqs.cfm?fid=2943

Paul Prewett
A: 

When you say without using a Database I guess you mean without using a third party database. There is no way around the fact you need to store and retrieve data while protecting against simultaneous access of underlying data structures causing problems, and this pretty much makes it a database. You could implement something simple by allocating some shared memory and using semaphores to protect access to it. Also you could have app A inform app B of changes to session state and have app B track these. This communication could be done over a named pipe between the apps. What OS are you targeting?

Howard May
A: 

How are you Identifying you user between the applications? What do you need in the session?

Not sure, but a web-service or wcf that passes the session variables back and forth for a given username || id?

( maybe not the session exactly but a object you could used to build/populate the session on both applications... )

User start session in App A, just before they move to App B store a small version of the session variables needed in cache with high priority but short expiry( this is what the web service would look for).

User stars session in App B, App B calls web service to see if user was in App A... if so get variables needed for App B?

No DBs, but you will need to do some work...

And not even sure this will solve what you looking for?

Used something kind of like this to talk from Admin servers on Production servers... But I wasn't passing the session itself...

Good Luck

BigBlondeViking