How can I make a HTTPHandler in an ashx file PLACE a SessionCookie managed by ASP.NET? It seems, that the call of an ashx-File does not place a cookie, so no session can be maintained.
Background: I am about to write HTTP based web service wrapper. Different clients call the URL I provide them with the given parameters. I check the credentials, call the 3rd party web service and deliver the changed result back to the client. The 3rd party web service provider demands by contract a SessionID for every different client calling.
Solution: An HTTPHandler seems to be the best choice. So I created a Web Site Project. Unfortunately a direct call of a ashx-File seems not to add a session cookie to the response, so a new SessionID is being created for every call from the same client.
I did the following relevant:
<sessionState mode="InProc" cookieless="false" timeout="20" />
to the web.configDifferent attempts which work, but should be avoided:
Version: IIS 6.0
IRequireSessionState
and IRequireReadOnlySessionState
are mutually exclusive. You should only be implementing the former if you intend to update session state in any way.