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

  • SEARCH
  • Home
  • 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 7908345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:53:40+00:00 2026-06-03T11:53:40+00:00

I am seeing a really wierd issue that only happens with non-administration users. When

  • 0

I am seeing a really wierd issue that only happens with non-administration users.

When the user logs in and accesses one page, they are logged out of the system. The page finishes loading as if they were logged in, but once they try any other actions (including refreshing the browser page) they are considered not logged in and presented with a login prompt.

Opening up fiddler, I can see one of the responses from the server contains the following:

Response sent 71 bytes of Cookie data:
Set-Cookie: portalaliasid=; expires=Sat, 08-May-1982 17:26:06 GMT; path=/; HttpOnly

Response sent 69 bytes of Cookie data:
Set-Cookie: portalroles=; expires=Sat, 08-May-1982 17:26:06 GMT; path=/; HttpOnly

Response sent 69 bytes of Cookie data:
Set-Cookie: .DOTNETNUKE=; expires=Tue, 12-Oct-1999 04:00:00 GMT; path=/; HttpOnly

Response sent 27 bytes of Cookie data:
Set-Cookie: language=; path=/; HttpOnly

Response sent 33 bytes of Cookie data:
Set-Cookie: authentication=; path=/; HttpOnly

This always seems to happen when I access my custom ashx web call. The code making this call is the following javascript:

$('#lstStates').empty();
var selectedRegions = $('select[id*=lbxRegions]').val();

// Get the list of states for the selected regions
$.ajax({
    url: '/DesktopModules/MyModule/ashx/GetStatesForRegions.ashx',
    data: { regions: selectedRegions },
    dataType: 'json',
    success: function (data) {
        if (IsArray(data)) {
            for (var state in data) {
                $('#lstStates').append('<option>' + data[state] + '</option>');
            }
        }
    }
});

The code in the ashx is

public class GetStatesForRegions : IHttpHandler
{
    public bool IsReusable { get { return false; } }

    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";

        // Get the list of region ids from the GET request
        string[] ids;
        string regionsArray = context.Request["regions[]"] ?? string.Empty;
        ids = regionsArray.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

        using (var dbContext = new MyDataContext())
        {
            string[] states;

            var query = dbContext.Schools.Where(x => x.PodRegionId != null);

            if (ids != null && ids.Length > 0)
                query = query.Where(x => ids.Contains(x.PodRegionId.ToString()));

            states = query.Select(x => x.xosAddress.State)
                          .Distinct()
                          .OrderBy(x => x)
                          .ToArray();

            context.Response.Write(JsonConvert.SerializeObject(states));
            context.Response.End();
        }
    }
}

Why is this clearing my relevant cookies and logging out non-administrator users?


Edit: To add to the mystery, when you access the ashx as a non-administrator DNN seems to return a 302 HTTP response, redirecting you to the same url again. That 302 response is what contains the cookie clearing data. The 2nd time it accesses the ashx (due to the redirect) the correct data is returned.

  • 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-03T11:53:42+00:00Added an answer on June 3, 2026 at 11:53 am

    This occurs because the user is only defined in the child portal, but the request to the ASHX occurs (from DNN’s perspective) in the parent portal. When DNN receives the request, it sees that you’ve “switched portals,” no longer have a valid identity, and removes your authentication information. This doesn’t occur for super users because they do have a valid identity across both portals.

    To fix this issue, you need to add a querystring parameter to your request with the portal ID. This let’s DNN disambiguate the request and keep your authentication intact:

    $.ajax({
        url: '/DesktopModules/MyModule/ashx/GetStatesForRegions.ashx?portalId=' + <%:PortalId%>,
        ....
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I feel like there must be something really simple that I'm not seeing here.
I'm seeing a really weird issue with this code and sample execution: https://gist.github.com/720278 The
I'm seeing a really strange issue with JPopupMenu's and JComboBox's. When the application is
I'm seeing a really strange behavior in one of my applications. It is an
I have this very weird issue that I cant really get why it's not
i'm seeing a really strange issue with asp.net rendering. i have EXACTLY this in
I'm really confused by a behaviour of LINQ I'm seeing and it's causing me
I'm seeing it pop up more and more and not really understanding the purpose
I've been seeing a lot of C# 4.0 changes as of late. I really
Maybe seeing the issue would help you all a little: https://ws.onehub.com/files/nzvrbj4s Screen Shots: https://ws.onehub.com/files/9rw3li12

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.