asp.net - Using same session for different domains in chrome -


i have 2 web applications , 1 web service application in asp.net (all of host in same server have different domain) (example : 213.74.99.50:9090 1 st app, 213.74.99.50:9091 second , 213.74.99.50:9093 fro web services)

i want use same sessions applications.

login @ first web app second app login data webservices.

i using stateserver mode, same keys machinekeys, make app name same in global.asax

there no problem internet explorer. everythings works fine. can use same sessions @ applications.

but when try in chrome or firefox have use "access-control-allow-origin=*"

but not working webservices. web applications use same sessions between them. bur web services cannot use same sessions in chrome , firefox.

this code: store session first application;

 protected void button1_click(object sender, eventargs e)     {         session["deneme"] = textbox1.text;          label1.text = session.sessionid;     } 

read session second application

 protected void button1_click(object sender, eventargs e)             {                 label1.text = session["deneme"]!=null?session["deneme"].tostring():"yok";                 label2.text = session.sessionid;             } 

return session web services

  [webservice(namespace = "http://tempuri.org/")]         [webservicebinding(conformsto = wsiprofiles.basicprofile1_1)]         [system.componentmodel.toolboxitem(false)]         [scriptservice]         public class sesdeneme : system.web.services.webservice         {              [webmethod(enablesession = true)]             public string helloworld()             {                  return (session["deneme"] != null ? session["deneme"].tostring() : "yok") + "____" + session.sessionid;              }         } 

for using same session different applications change web configs of apps.

<sessionstate mode="stateserver"                   cookiename="scs_01"    stateconnectionstring="tcpip=localhost:42424"    cookieless="false"    timeout="20"/>        <machinekey decryption="auto"                 decryptionkey="xxxx"                 validation="sha1"                 validationkey="yyyy" />  

and make app names same global.asax

protected void application_start(object sender, eventargs e)             {                 string applicationname = "mysitename";                              fieldinfo runtimeinfo = typeof(httpruntime).getfield("_theruntime", bindingflags.static | bindingflags.nonpublic);                 httpruntime theruntime = (httpruntime)runtimeinfo.getvalue(null);                 fieldinfo appnameinfo = typeof(httpruntime).getfield("_appdomainappid", bindingflags.instance | bindingflags.nonpublic);                  appnameinfo.setvalue(theruntime, applicationname);             } 

after can use same sessions applications in internet explorer.

but using firefox , chrome add web configs of apps

<customheaders>      <add name="access-control-allow-origin" value="*" />      <add name="access-control-allow-headers" value="content-type" /> </customheaders> 

this way can use same session web applications not work web services.

is there way solve problem

i noticed something. if call web service directly chrome (not web applications) session works fine. if call webservice jquery.ajax method cannnot reach sessions.

i think jquery ajax using different cookie key in chrome.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -