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 8267809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:40:06+00:00 2026-06-08T05:40:06+00:00

I have a ASP.NET Web Service which exposes a method called DoLogin [WebService(Namespace =

  • 0

I have a ASP.NET Web Service which exposes a method called DoLogin

[WebService(Namespace = "http://rtns.ism.ec/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]    
[ScriptService]
public class UserManagerService : WebServiceBase
{

    [WebMethod(EnableSession=true)]
    [ScriptMethod]
    public ResponseBase<bool> DoLogin(LoginCredentials Credentials)
    {
        Credentials.IpAddress = HttpContext.Current.Request.UserHostAddress;
        Credentials.ServerID = Environment.MachineName;
        Credentials.SystemID = WebConfigurationManager.AppSettings["SYSTEM_ID"];
        Credentials.UserAgent = HttpContext.Current.Request.UserAgent;

        try
        {
            DataResponse<User> resp = UserManager.LoginUser(Credentials);

            if (resp.Code)
            {
                FormsAuthentication.SetAuthCookie(Credentials.Email, true);
                HttpContext.Current.Session.Add(Constants.Identifiers.USER_SESSION_INFO_IDENTIFIER, resp.Data);
            }
            return resp;
        }
        catch (Exception _ex)
        {
            ISM.Essentials.Business.LogManager.SaveLog(_ex);
            return new ResponseBase<bool> { Message = MessageManager.Instance[Constants.Messages.E_GENERIC_FAILURE, Credentials.CultureID] };
        }
    }

}

I have a JQuery client, which makes the call:

function loginSubmitHandler() {

    var objeto = {
        Email: $('#txtUser').val(),
        Password: $('#txtPassword').val(),
        CultureID: $('#hddCulture').val()
    };

    utils.startAjaxCall('../Services/UserManagerService.asmx/DoLogin', { Credentials: objeto }, function(data) {

    if (data.d.Code) {
        window.location.replace('home.aspx');
    }
    else
    {
        utils.alert(locals.Information, locals.Accept, data.d.Message);            
    }
    });

    return false;
}

When I log in with icorrect credentials, the alert with the message sent from the server appears. If I give correct credentials, the page is redirected to home.aspx

This code is working 100% fine since the begining in the following browsers:

  • IE6, 7, 8, 9
  • Mozilla
  • IE9 Windows Phone
  • Android 2.3 Browser
  • Safari 5.1 for Windows

I’ve just got a Mac (first ever) and when I tried to access my website, I noticed an extrange behavior. I give correct login credentials, I’m redirected to home, but the FormsAuthentication mechanism redirects back to the login page.

It seems like the Auth cookie returned back from the server is just ignored.

This is not an issue with cross domain cookies, as I’m calling the web server in the same web application/domain.

Any ideas on how to make Safari for Mac to accept the cookies returned in an Ajax Web Service call?

  • 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-08T05:40:10+00:00Added an answer on June 8, 2026 at 5:40 am

    The problem might be that safari will not set cookies with non-ASCII characters. Try using encodeURIComponent() function on cookie values. Here is a link with similar problem:
    Strange problem with cookies in Safari and Asp.net

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

Sidebar

Related Questions

We have a simple ASP.Net WCF Ajax enabled web service which is called via
I have an ASP.net web service that I'm using for a web application which
I have an ASP.NET web service running that accepts both HTTP POST and SOAP
I have an ASP.NET web service which will create a text file in a
I have a Hello World c# ASP .NET web service which is automatically generated
We have an ASMX web service which we invoke from our ASP.NET application using
I have a asp.net web-service which I use from my ASP.NET website. I can
I have ASP.NET web service, which is creating file in XML table format. I
I have an ASP.NET web service which does some heavy lifting, like say,some file
I have an ASP.NET (1.1) web service which authenticates clients using a SoapExtension.ProcessMessage(SoapMessage) override

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.