skip to Main Content

I have created one web application and when i run application in normal browser windows it works perfectly. But when i open same application in iFrame tag my cookies get vanished automatically.

When I Inspect browser window i can see the cookies and session but it won’t work.
enter image description here

2

Answers


  1. Chosen as BEST ANSWER
    I have added below config in web.config file 
    
     <sessionState mode="InProc" timeout="500" cookieSameSite="None"/> 
            <httpCookies httpOnlyCookies="true" requireSSL="true" domain="local.com"/>
            <authentication mode="Forms">
                <forms loginUrl="~/Auth" timeout="500" slidingExpiration="true" domain="local.com"/> 
            </authentication>
    
    But still cookies not set. Could you please assist?
    

  2. This is probably because you have not set the domain on the web.config

    Some times you call the iframe with out the www. on your domain, and this is set a different cookie than when you have the www.

    so on web.config set the domain where its needed, eg:

    <authentication mode="Forms">
      <forms domain="local.com" />
    </authentication>
    
    <httpCookies domain="local.com" />
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search