OK, my face become bit red - so silly mistake, thanks for pointing out
But - we are getting to the final question. I took a lesson from your "sample approach" and hopefully this is how you can reproduce my original problem:
presuming that you have IIS application called "mobileSample"
apsx page ( similar to your one)
<%@ Page Language="C#" %>
<!DOCTYPE html>
<script runat="server">
[DirectMethod]
public void Login()
{
FormsAuthentication.SetAuthCookie("TestUser", true);
}
[DirectMethod]
public string AuthenticatedName()
{
return "user: " + HttpContext.Current.User.Identity.Name;
}
</script>
<html>
<head runat="server">
<title></title>
<script type="text/javascript">
function beforeRequest(con, options, eOpts, params, request) {
request.url = "http://kilkelly/mobileSample/default.aspx";
}
function btnLogin_click() {
App.direct.Login({
complete: function () {
Ext.Msg.alert('logon', 'logged in');
}
});
}
function btnTestAuthentication_click() {
App.direct.AuthenticatedName({
complete: function (success, result) {
Ext.Msg.alert('auth', 'logged as ' + result);
}
});
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<ext:ResourceManager runat="server" >
<Listeners>
<BeforeAjaxRequest Fn="beforeRequest"></BeforeAjaxRequest>
</Listeners>
</ext:ResourceManager>
<ext:Container runat="server" FullScreen="true">
<Items>
<ext:Button runat="server" Text="login" OnClientTap="btnLogin_click();" />
<ext:Button runat="server" Text="check auth" OnClientTap="btnTestAuthentication_click();" />
</Items>
</ext:Container>
</div>
</form>
</body>
</html>
On line 24 please replace kilkelly with your computer name
web.config shortened as much as I can
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="extnetmobile" type="Ext.Net.Mobile.GlobalConfig" requirePermission="false"/>
</configSections>
<extnetmobile scriptMode="Debug" licenseKey=" ** Ext.NET Mobile License Key ** " />
<location path="default.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<system.web>
<compilation debug="true" targetFramework="4.6"/>
<authentication mode="Forms">
<forms loginUrl="LoginTo.aspx" cookieless="UseCookies"/>
</authentication>
<pages controlRenderingCompatibilityVersion="4.0">
<controls>
<add assembly="Ext.Net.Mobile" namespace="Ext.Net.Mobile" tagPrefix="ext"/>
</controls>
<namespaces>
<add namespace="Ext.Net.Mobile"/>
</namespaces>
</pages>
</system.web>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Methods" value="*" />
<add name="Access-Control-Allow-Headers" value="X-Ext-Net,X-Ext-Net-Mobile,X-Requested-With" />
</customHeaders>
</httpProtocol>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
<add name="DirectRequestHandler" verb="*" path="*/ext-mobile.axd" preCondition="integratedMode" type="Ext.Net.Mobile.ResourceHandler"/>
</handlers>
<modules>
<add name="DirectRequestModule" preCondition="managedHandler" type="Ext.Net.Mobile.DirectRequestModule, Ext.Net.Mobile"/>
</modules>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed"/>
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Ext.Net.Utilities" publicKeyToken="2c34ac34702a3c23"/>
<bindingRedirect oldVersion="0.0.0.0-2.5.0" newVersion="2.5.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Transformer.NET" publicKeyToken="e274d618e7c603a7"/>
<bindingRedirect oldVersion="0.0.0.0-2.1.1" newVersion="2.1.1"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
now if you browse application using
http://kilkelly/mobilesample (or whatever your PC name is) it works fine user is logged and username is displayed
hovewer if you browse application using
http://localhost/mobilesample the user is not retrieved back
Even cookies always come from
http://kilkelly/mobilesampel and are supposed to be read from here