473,769 Members | 2,078 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Connect to session

Hi.
How can I join session or read Session variables if I have the SessionID
(or anything what I can supply)?

Imagine I have a external link from my webpages, which opens an application
which is expected to make requests to the server. It starts another session,
but I need to use the session from browser.
To the link I'm able to send any property the server can give me.

Thanks, Jan.
May 7 '06 #1
17 1589
what a confusion you said !!!
can you simplefy what you need?

if you have website A and website B, if not in the same server they will
have diferent sessions (even if using the same name)

to send info from website A to website B use the POST or GET and them
populate the new website with the values.

example to send session("name") and session("userna me") from website A to
website B
website A

session("name") = "Bruno"
session("userna me") = "balexandre "

the link to open the new website B if you're using GET method sould be like
this

www.domainB.com/websiteBpage.aspx?un= & session("userna me") & "&n=" &
session("name")

in website B populate the sessions using the QueryString method

session("name") = request.queryst ring("n")
session("userna me") = request.queryst ring("un")

--

Bruno Alexandre
(a Portuguese in Denmark)

"Jan Kucera" <ua*@centrum.cz > escreveu na mensagem
news:e1******** *****@TK2MSFTNG P05.phx.gbl...
Hi.
How can I join session or read Session variables if I have the SessionID
(or anything what I can supply)?

Imagine I have a external link from my webpages, which opens an
application which is expected to make requests to the server. It starts
another session, but I need to use the session from browser.
To the link I'm able to send any property the server can give me.

Thanks, Jan.

May 7 '06 #2
Okay sorry if I made a big confusion to you ! :-)

So. Firstly I have only one site. I will make concrete examples with the
real situation I have, I just thought it will complicate everything.

User logs into the web using Windows authentication. On the web, he opens a
project. Each user has CurrentProject variable in his Session.
Now, on some page, there is link to a Word document. The Word document opens
and -using macro- is about to update its content from CurrentProject at the
web server.
I have handler/web service published to return values to the document, for
example http://myserver/getcontent.ashx. However, Word starts new session
with its request.

And thats it. At the handler I need to get the CurrentProject but I don't
have the session into which the user logged in.

I thought that I could send I don't know eg. SessionID, so the Word can ask
for http://myserver/getcontent.ashx?SessionID=id, and on the server side, I
can get the proper session and its CurrentProject.

I have no control of the request stream (thus headers) from the Word.

Is that somewhat clearer?
Jan
May 7 '06 #3
V
Hi Jan,

Word will always act like a new client and hence will start a new
session. I am not too sure if you can re-use a session in teh way that
you are visualizing it or not, but here is a work around:

Create a session table in the database. This way, what you can do is
when a user logs in, you can make an entry of the session (and
associated variables) in the database. Now you can pass the SessionID
or the UserID to your word document, which can pass it on to the web
service through its macro. The web service can then recreate the
session from the database.

I hope that helped.

Regards,
Vaibhav

May 7 '06 #4
now I know what you need, but that's WORD programming issue

try to add this question in microsoft.publi c.word.programm ing newsgroup,
maybe they will responde to u better that the folhs in this NG

--

Bruno Alexandre
(a Portuguese in Denmark)

"Jan Kucera" <ua*@centrum.cz > escreveu na mensagem
news:uJ******** ******@TK2MSFTN GP05.phx.gbl...
Okay sorry if I made a big confusion to you ! :-)

So. Firstly I have only one site. I will make concrete examples with the
real situation I have, I just thought it will complicate everything.

User logs into the web using Windows authentication. On the web, he opens
a project. Each user has CurrentProject variable in his Session.
Now, on some page, there is link to a Word document. The Word document
opens and -using macro- is about to update its content from CurrentProject
at the web server.
I have handler/web service published to return values to the document, for
example http://myserver/getcontent.ashx. However, Word starts new session
with its request.

And thats it. At the handler I need to get the CurrentProject but I don't
have the session into which the user logged in.

I thought that I could send I don't know eg. SessionID, so the Word can
ask for http://myserver/getcontent.ashx?SessionID=id, and on the server
side, I can get the proper session and its CurrentProject.

I have no control of the request stream (thus headers) from the Word.

Is that somewhat clearer?
Jan

May 7 '06 #5
Actually not, this is not Word issue at all and reason why I didn't talked
about Word before.

So what I need is a collection of Session objects for Application,
accessable by SessionID as a key...

I need something like Session = Application.Ses sions[mySessionID];

By the way, how do I find current session count and iterate over them?
"Bruno Alexandre" <br*******@filt rarte.com> wrote in message
news:ey******** ******@TK2MSFTN GP05.phx.gbl...
now I know what you need, but that's WORD programming issue

try to add this question in microsoft.publi c.word.programm ing newsgroup,
maybe they will responde to u better that the folhs in this NG

--

Bruno Alexandre
(a Portuguese in Denmark)

"Jan Kucera" <ua*@centrum.cz > escreveu na mensagem
news:uJ******** ******@TK2MSFTN GP05.phx.gbl...
Okay sorry if I made a big confusion to you ! :-)

So. Firstly I have only one site. I will make concrete examples with the
real situation I have, I just thought it will complicate everything.

User logs into the web using Windows authentication. On the web, he opens
a project. Each user has CurrentProject variable in his Session.
Now, on some page, there is link to a Word document. The Word document
opens and -using macro- is about to update its content from
CurrentProject at the web server.
I have handler/web service published to return values to the document,
for example http://myserver/getcontent.ashx. However, Word starts new
session with its request.

And thats it. At the handler I need to get the CurrentProject but I don't
have the session into which the user logged in.

I thought that I could send I don't know eg. SessionID, so the Word can
ask for http://myserver/getcontent.ashx?SessionID=id, and on the server
side, I can get the proper session and its CurrentProject.

I have no control of the request stream (thus headers) from the Word.

Is that somewhat clearer?
Jan


May 7 '06 #6
You don't. I don't believe that is supported in ASP.NET
not unless you manage your own providers and keep
track of them in your own code.

--
Robbe Morris - 2004-2006 Microsoft MVP C#
Earn money answering .NET questions
http://www.eggheadcafe.com/forums/merit.asp

"Jan Kucera" <ua*@centrum.cz > wrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
Actually not, this is not Word issue at all and reason why I didn't talked
about Word before.

So what I need is a collection of Session objects for Application,
accessable by SessionID as a key...

I need something like Session = Application.Ses sions[mySessionID];

By the way, how do I find current session count and iterate over them?
"Bruno Alexandre" <br*******@filt rarte.com> wrote in message
news:ey******** ******@TK2MSFTN GP05.phx.gbl...
now I know what you need, but that's WORD programming issue

try to add this question in microsoft.publi c.word.programm ing newsgroup,
maybe they will responde to u better that the folhs in this NG

--

Bruno Alexandre
(a Portuguese in Denmark)

"Jan Kucera" <ua*@centrum.cz > escreveu na mensagem
news:uJ******** ******@TK2MSFTN GP05.phx.gbl...
Okay sorry if I made a big confusion to you ! :-)

So. Firstly I have only one site. I will make concrete examples with the
real situation I have, I just thought it will complicate everything.

User logs into the web using Windows authentication. On the web, he
opens a project. Each user has CurrentProject variable in his Session.
Now, on some page, there is link to a Word document. The Word document
opens and -using macro- is about to update its content from
CurrentProject at the web server.
I have handler/web service published to return values to the document,
for example http://myserver/getcontent.ashx. However, Word starts new
session with its request.

And thats it. At the handler I need to get the CurrentProject but I
don't have the session into which the user logged in.

I thought that I could send I don't know eg. SessionID, so the Word can
ask for http://myserver/getcontent.ashx?SessionID=id, and on the server
side, I can get the proper session and its CurrentProject.

I have no control of the request stream (thus headers) from the Word.

Is that somewhat clearer?
Jan



May 7 '06 #7
Once u have sessionID , Try setting ASPNET cookie in your
application's process by Wininet call ( InternetSetCook ie )

Nirmal

Jan Kucera wrote:
Hi.
How can I join session or read Session variables if I have the SessionID
(or anything what I can supply)?

Imagine I have a external link from my webpages, which opens an application
which is expected to make requests to the server. It starts another session,
but I need to use the session from browser.
To the link I'm able to send any property the server can give me.

Thanks, Jan.


May 7 '06 #8
Isn't that something like storing session in db?

I understand the reason why there is new session and I know how and am able
to pass session or user id to the link.

However I store quite complex and not serializable types in session. And,
this would create two concurrent sessions, which will not be synchronized.
This is bad for me.

But thanks for the idea.
Jan
May 7 '06 #9
So am I free to store a HttpSession array in Application object? How
expensive would be that?

"Robbe Morris [C# MVP]" <in**@eggheadca fe.com> wrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
You don't. I don't believe that is supported in ASP.NET
not unless you manage your own providers and keep
track of them in your own code.

--
Robbe Morris - 2004-2006 Microsoft MVP C#
Earn money answering .NET questions
http://www.eggheadcafe.com/forums/merit.asp

"Jan Kucera" <ua*@centrum.cz > wrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
Actually not, this is not Word issue at all and reason why I didn't
talked about Word before.

So what I need is a collection of Session objects for Application,
accessable by SessionID as a key...

I need something like Session = Application.Ses sions[mySessionID];

By the way, how do I find current session count and iterate over them?
"Bruno Alexandre" <br*******@filt rarte.com> wrote in message
news:ey******** ******@TK2MSFTN GP05.phx.gbl...
now I know what you need, but that's WORD programming issue

try to add this question in microsoft.publi c.word.programm ing newsgroup,
maybe they will responde to u better that the folhs in this NG

--

Bruno Alexandre
(a Portuguese in Denmark)

"Jan Kucera" <ua*@centrum.cz > escreveu na mensagem
news:uJ******** ******@TK2MSFTN GP05.phx.gbl...
Okay sorry if I made a big confusion to you ! :-)

So. Firstly I have only one site. I will make concrete examples with
the real situation I have, I just thought it will complicate
everything.

User logs into the web using Windows authentication. On the web, he
opens a project. Each user has CurrentProject variable in his Session.
Now, on some page, there is link to a Word document. The Word document
opens and -using macro- is about to update its content from
CurrentProject at the web server.
I have handler/web service published to return values to the document,
for example http://myserver/getcontent.ashx. However, Word starts new
session with its request.

And thats it. At the handler I need to get the CurrentProject but I
don't have the session into which the user logged in.

I thought that I could send I don't know eg. SessionID, so the Word can
ask for http://myserver/getcontent.ashx?SessionID=id, and on the server
side, I can get the proper session and its CurrentProject.

I have no control of the request stream (thus headers) from the Word.

Is that somewhat clearer?
Jan



May 7 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2322
by: Brian Pittman | last post by:
Hi all, As the subject says I'm having trouble connecting to SQL Server 2K via Visual Studio.NET 2002 (VB). It tells me that SQL Server does not exist or access is denied. I know that the server exists because its on the machine I'm working on. There is no reason for me to be denied access. I am using a trusted connection and access has been granted to the ASPNET account for the referenced Database. I have been developing asp apps...
4
4082
tolkienarda
by: tolkienarda | last post by:
Hi all I work for a small webdesign company and we have remote hosting. i built a mysql database with phpmyadmin on the server. i then downloaded and modified a php login page. i am continuing to get the ---invalid username or password--- i am not getting the E_USER_ERROR so i don't know if there is a problem with the php, how i set up the database or mabe somthing in between. so everyone knows all of my server interface is GUI. I use a company...
1
2046
by: GNoter | last post by:
Scenario: I've a WebFarm with 2 web servers which are NLBs (network load balanced). Web1 and Web2; they are not part of a domain. I have a third server, Server3, which is part of a domain and on the same physical network, and it has an MSAccess database which is used on the external webfarm as well as on the internal intranet. I can connect via the intranet because the DB file is on the same box from which the intranet is being served...
1
6065
by: fbk2k5 | last post by:
hi i have a problem to connect the user inside the stored procedure in oracle i tried option CREATE OR REPLACE PROCEDURE Chk_Permission AS UserID VARCHAR2(10):='1234'; fname VARCHAR2(20):='franklin'; lname VARCHAR2(20):='baskar';
3
2759
by: LamSoft | last post by:
I am not going to write a aspx to connect a SQL Server... but it tries to connect the SQL Server... Some of the Code.. protected void LoginButton_Click(object sender, EventArgs e) { if (Request.Form == null || Request.Form == "") { Session = "LocalHost"; }
3
5673
by: nickyeng | last post by:
i know alot of people faced this problem before. i searched google.com i search javaranch.com, no one article can help me solve the problem. I runs it in my localhost server, it runs well. But when i runs it in my company's server, it give this error : ---- javax.mail.SendFailedException: Sending failed; nested exception is: class javax.mail.MessagingException: Could not connect to SMTP host: mail.as.com.my, port: 25; nested exception is:...
1
4394
by: vibhavleo | last post by:
I am using the Microsoft Office 11.0 Object library to connect to outlook. My code is as follows: _ApplicationPtr application("Outlook.Application"); CComPtr<_NameSpace> ns; CComPtr<_NameSpace> session; hr = application->GetNamespace(CComBSTR("MAPI"),&session.p); if(hr != S_OK) return hr; hr = application->get_Session(&session.p); if(hr != S_OK) return hr; hr =...
3
1423
by: jc | last post by:
Hi there: Reading from internet i found that the best way to use a database is to connect and disconnect on every single database request, so if you are loading a listbox manually from a database and on the same page, loading a grid from the database, then the best way is to connect to database, load the listbox, disconnect, connect again, load the grid and disconnect. what is the cause because to reconnect many times is more
8
6093
by: inpuarg | last post by:
I 'm developing a c# (.net 2.0) windows forms application and in this application i want to connect to a java servlet page (HTTPS) (which is servlet 2.4 and which may be using Web Based SSO Sun Java System Access Manager but i 'm not sure), handle session management, get token, send data using post and get methods etc. I listened http traffic using Fiddler and sending the same messages from my application but browser based navigation is...
0
9579
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10208
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9857
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8867
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7404
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5294
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3558
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2812
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.