Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7900237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:55:08+00:00 2026-06-03T08:55:08+00:00

How can I make a HTTPHandler in an ashx file PLACE a SessionCookie managed

  • 0

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:

  • Implemented markup interfaces IRequiresSessionState or/and
    IReadOnlySessionState
  • Added <sessionState mode="InProc" cookieless="false" timeout="20" />
    to the web.config
  • Save something in the session state in the Global.asax File in the
    Session_Start-Method HttpContext.Current.Session(“init”) = 0

Different attempts which work, but should be avoided:

  • Before calling the ashx-File a call of the Default.aspx File places a session cookie, so the session is being maintained.
  • Implement an “own” Session with a database and a timestamp.

Version: IIS 6.0

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T08:55:10+00:00Added an answer on June 3, 2026 at 8:55 am

    IRequireSessionState and IRequireReadOnlySessionState are mutually exclusive. You should only be implementing the former if you intend to update session state in any way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can make a new , and that seems to work. But edit/update does
I can make a log in for easily, so that's not the problem. What
How can I make a project file (VS 2008) that just has some data
How can make a link within a facebox window that redirects it to another
I can make batch or vbs file on windows and run. this can automate
IIS enables us to also configure Asp.Net file mappings. Thus besides aspx, IIS also
The file system part of our asp.net application framework requires updating to fall inline
I am attempting to write an ASP.net web service that will be utilized by
How can I make that a site automagically show a nice Currently Offline page
Years ago (.net 2005, C#) I used to make an AJAX call via javascript

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.