How Access the session value ?

G

Gopal Prabhakaran

Dear All,

In one solution , I have 2 webapplication,

Now i want to access session value form webapplication 1 to webapplication
2.

Pls help ASAP

Millions of Thanx in advance.
 
C

Cowboy \(Gregory A. Beamer\)

At present, I have not figured out a method to do this directly (with the
syntax: varIWant = Session["VarIWant"];). You can do the following to
facilitate a single auth mechanism.

1. Set forms auth cookie to the same name in each app
2. Set the machine keys to the same value in each app

This will allow you to pick up the session ID and know who the user is. And,
it is half the battle in solving the problem.

When you attempt to get session values from one app to another, you throw an
exception over invalid namespaces. Since the two are in the same project,
you might be able to access by placing a reference from one to the other. I
am not sure what will happen if you create a circular reference, but I have
a feeling you will have to cement your build numbers, or tweak the .config
file to get this to work. I have not experimentated enough, but there may be
another method to get namespaces figured out.

I have a colleague at work who had a similar problem to yours. The solution
was to make a class with static methods for placing and pulling these values
from persistant storage (in this case, SQL Server 2000). Each method was
overloaded to accept/return a group of name/value pairs or a single value.
It works rather nicely on applications, like ours, that are ported from ASP
code written with lots of session values.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 

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

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top