How to share a web application session with a web service

Here is the script. My page loads with certain objects in the session. The user clicks a button and I need to refresh a specific section of my page using jquery. JQuery will make an ajax call to a web service that needs to access one of the objects in the session. How can I do it? How can my web service access the current session object?

update: I am using asmx

+1
source share
2 answers

everything you do is set (EnableSession = true) in your webmethod attribute.

+2
source

If your building is a WCF service, you can set this attribute in the class:

[AspNetCompatibilityRequirements (RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] 

What should give you access. If you use asmx, I donโ€™t remember the head.

0
source

Source: https://habr.com/ru/post/1402452/


All Articles