473,722 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access Session from another class?

Hi

How can i access Sessionstate from another class?
Lets say i have webservice where i define Session["lib"]=1;

In my webservice project i have a common class.

How can i access Session["lib"] from this class?

Sry. about my poor Englisgh :)

Best regards;
Mex
Sep 22 '07 #1
4 1549
"Redivivus" <me***********@ deltmar.eewrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
Hi

How can i access Sessionstate from another class?
Lets say i have webservice where i define Session["lib"]=1;

In my webservice project i have a common class.

How can i access Session["lib"] from this class?

Sry. about my poor Englisgh :)
Try HttpContext.Cur rent.Session["lib"].
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer

Sep 23 '07 #2
thnx John

But how to access same session from another WebService?

Mex
"John Saunders [MVP]" <john.saunder s at trizetto.comwro te in message
news:OC******** ******@TK2MSFTN GP03.phx.gbl...
"Redivivus" <me***********@ deltmar.eewrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
>Hi

How can i access Sessionstate from another class?
Lets say i have webservice where i define Session["lib"]=1;

In my webservice project i have a common class.

How can i access Session["lib"] from this class?

Sry. about my poor Englisgh :)

Try HttpContext.Cur rent.Session["lib"].
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer

Sep 23 '07 #3
"Redivivus" <me***********@ deltmar.eewrote in message
news:Or******** ******@TK2MSFTN GP05.phx.gbl...
thnx John

But how to access same session from another WebService?
I'm sorry, that doesn't make sense. Two web services shouldn't communicate
via Session. They should communicate with explicit calls from one to the
other.

Perhaps I'm misunderstandin g your question. What is your scenario with the
two web services?
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer

Sep 24 '07 #4
hi,

as long as they are from the same application, they should share the same
session. If they are not the same application, I think you are taking the
problem the wrong way...

I hope it helps

ThunderMusic

"Redivivus" <me***********@ deltmar.eewrote in message
news:Or******** ******@TK2MSFTN GP05.phx.gbl...
thnx John

But how to access same session from another WebService?

Mex
"John Saunders [MVP]" <john.saunder s at trizetto.comwro te in message
news:OC******** ******@TK2MSFTN GP03.phx.gbl...
>"Redivivus" <me***********@ deltmar.eewrote in message
news:%2******* *********@TK2MS FTNGP04.phx.gbl ...
>>Hi

How can i access Sessionstate from another class?
Lets say i have webservice where i define Session["lib"]=1;

In my webservice project i have a common class.

How can i access Session["lib"] from this class?

Sry. about my poor Englisgh :)

Try HttpContext.Cur rent.Session["lib"].
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer


Sep 24 '07 #5

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

Similar topics

8
2958
by: Frnak McKenney | last post by:
Back when computer dinosaurs roamed the earth and the precursors to today's Internet were tiny flocks of TDMs living symbiotically with the silicon giants, tracking access to data processing resources was much simpler: you logged in with a userID and password, and when you were done you ended your session by logging out (or occasionally by being disconnected). Connection time was easy to measure, and it made sense to both the customer...
6
4749
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much appreciated. Thanks in advance
2
1012
by: Gopal Prabhakaran | last post by:
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.
2
2389
by: Boban Dragojlovic | last post by:
I'm building a complex web-based reservations system. Gathering the user's data requires between 8 and 15 pages (depending on which options they are interested in). I use the "Session" object to store the various elements as the user moves through the pages. Rather than storing the preferences directly in the Session object (e.g. Session("LastName") = ...), I created a class <Serializable()> Public Class ReservationInfo
3
1582
by: Wee Bubba | last post by:
i have a seperate class which i want to access the session state from. as a workaround i am able to access the session state by inheriting from the Page class. but this seems a waste as I dont need any other Page features. i.e. public class Stopwatch : Page //inherit from Page class to get access to session object { ... }
13
1755
by: | last post by:
Simple question, I think... I'm storing an object in the Session object. In the code behind I read that object: trx = CType(Session("Transaction"), BOCSTransaction) If I change any properties, I have to store it back into the session object to "update" it, right? Or will the changes to my object automatically be saved back into the session object? Thanks, Jerry
2
2444
by: Daflookie | last post by:
For one reason or another I am unable to access Session contents in my asp.net application via the global.asax's Application_Error event. I can pull this exact code snippet below out of global.asax and place it in a normal page (or class file that doesn't inherit from system.web.ui.page) and things work fine: Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs) Dim currentContext As System.Web.HttpContext =...
9
2163
by: JT | last post by:
Here is the overall structure I will be referring to: End-program ProvideWorkFlow.dll Forms and methods that properly manipulate calls to methods in AccessUtils AccessUtils (a web service) Hide.dll methods and data I want to remain hidden I have a DLL, Hide.dll, that contains methods that I want to handle for
6
1921
by: Joseph I. Ceasar | last post by:
I have an ASP .Net 2.0 site that I am working on. It has a master page and a content page. I also created a separate class module that returns a DataSet to feed my GridView. So far, so good. The thing is that the method that returns the DataSet is computationally expensive and I really need to create the whole DataSet only once per session. Once it's created, I'd like to return the same DataSet to the GridView for operations such as...
0
8867
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
9239
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9158
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
9090
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
8059
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...
0
4503
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
4764
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3208
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
2
2606
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.