473,779 Members | 1,952 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
17 1590
V
Hi Jan,

I was looking up on how to solve your problem, and came across a link
which states something that might also affect your situation. Copying
from the link:

Q: How do I use session state with web services?
A: The extra trick needed is on the caller side. You have to save and
store the cookies used by the web service. See the MSDN documentation
on HttpWebClientPr otocol.CookieCo ntainer property.

However, please note if you're using proxy object to call a web service
from your page, the web service and your page cannot share the same
session state due to architecture limitation.

This can be done if you call your web service through redirect.

The link is: http://www.eggheadcafe.com/articles/20021016.asp. This
site is really good and you may want to post your problem there and you
can be sure of a decent response.

Incidentally, I am assuming that the webservice is in the same
appdomain as your web application.

Regards,
Vaibhav

May 7 '06 #11
Yes, I have just the asmx file in the web project I'm thinking about.

Thank you for the link, I will read through.
Jan
"V" <va************ *@gmail.com> wrote in message
news:11******** ************@u7 2g2000cwu.googl egroups.com...
Hi Jan,

I was looking up on how to solve your problem, and came across a link
which states something that might also affect your situation. Copying
from the link:

Q: How do I use session state with web services?
A: The extra trick needed is on the caller side. You have to save and
store the cookies used by the web service. See the MSDN documentation
on HttpWebClientPr otocol.CookieCo ntainer property.

However, please note if you're using proxy object to call a web service
from your page, the web service and your page cannot share the same
session state due to architecture limitation.

This can be done if you call your web service through redirect.

The link is: http://www.eggheadcafe.com/articles/20021016.asp. This
site is really good and you may want to post your problem there and you
can be sure of a decent response.

Incidentally, I am assuming that the webservice is in the same
appdomain as your web application.

Regards,
Vaibhav

May 7 '06 #12
It seems the CookieContainer stuff in web service will exactly do what I
need.

Posting this also in webservices groups, so hi all.

I have a web service, which is accessed using GET protocol. I'm accessing it
using Microsoft XML, 2.0 library (this is the reason for GET), by calling
xmldoc.load(http://server/myservice.asmx/helloworld?name=Xaver).

Now, this asmx file is in the asp.net web project and I need it to use
active session. I've read (thanks to Vaibhav) that the CookieContainer can
be used to get the correct session on the server side, however... I can't
(or at least I think I can't - question to XML group) modify the request
header of Microsoft's XML parser load function. I'm afraid there is no
chance packing CookieContainer into URL, is it?

So... any idea how to call the webservice with the correct session?

Thanks,
Jan.
May 7 '06 #13
V
Hi Jan,

I am not even sure if what I am saying would work, but just throwing
possibilities in the air. What if you used cookieless sessions, in
which case the sessionID is passed as part of the URL. Maybe then if
you included the SessionID in the webservice URL (when called from the
word doc) the session might get re-established?

Just a thought.

Regards,
Vaibhav

May 7 '06 #14
I also thought about this, I would try and get know.
I read about the CookieContainer in the MSDN and it seems it will do that
work. Unfortunately if nobody says I can pass it in the URL or I can modify
the request header of MSXML2, I can't use it.
Jan

"V" <va************ *@gmail.com> wrote in message
news:11******** **************@ g10g2000cwb.goo glegroups.com.. .
Hi Jan,

I am not even sure if what I am saying would work, but just throwing
possibilities in the air. What if you used cookieless sessions, in
which case the sessionID is passed as part of the URL. Maybe then if
you included the SessionID in the webservice URL (when called from the
word doc) the session might get re-established?

Just a thought.

Regards,
Vaibhav

May 8 '06 #15
Well Vaibhav, I've tried it and cookieless session does not work. Even from
the browser, the session is not restored.
I will try to manually add some session id to the request header, maybe I
found how. Just for start, do you know what tags should I have in the header
to restore the session?
Thanks, Jan.

"Jan Kucera" <ua*@centrum.cz > wrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
I also thought about this, I would try and get know.

May 8 '06 #16
V
Sorry Jan,

I do not, and I will not be able to look into this problem today :(

I suddenly have a lot of work at the office. Do let me know if you
manage to solve the problem; it is an interesting problem.

I will pick it up if you still haven't solved it when i am done with my
work. Hopefully, together we may be able to solve something.

Regards,
Vaibhav

May 8 '06 #17
Hi Vaibhav.
Thank you very much for your item.
I did some investigation on packets and found out, that all that is sent
about the session is Set-Cookie from the server and Cookie from the IE
requests, in that form:

Cookie: ASP.NET_Session iD=[theSessionIDret urnedBySessionO bject]

Which gives me very big expectations...
However the MSXML2 which I'm using .... I'm not able to set the header with
it. I found it has a bug and the cookie header must be set twice, however
this didn't help, I see still no cookie header in the request packet. :(

(Can anybody confirm that providing valid session id in the header will get
into the session on server side? What else should be present for IIS not to
require authorization again?)

Jan.

"V" <va************ *@gmail.com> wrote in message
news:11******** **************@ v46g2000cwv.goo glegroups.com.. .
Sorry Jan,

I do not, and I will not be able to look into this problem today :(

I suddenly have a lot of work at the office. Do let me know if you
manage to solve the problem; it is an interesting problem.

I will pick it up if you still haven't solved it when i am done with my
work. Hopefully, together we may be able to solve something.

Regards,
Vaibhav

May 8 '06 #18

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
2047
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
6066
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
2760
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
6095
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
9474
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10306
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...
1
10074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8961
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
7485
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
5373
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
5503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2869
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.