locked
Session variables not working in IE for c#.net RRS feed

  • Question

  • User295590651 posted

     Hi All,

    I have a very unique problem I am trying to reslove from few weeks but I am not able to , Any help would be much appreciated.

    I am using session variables and redirecting from one page to another.

    the problem I am facing is the session variables are not working in IE and safari, i am getting an object refrence error since the session variables are not available in ridirected page.

     It works absolutely fine with chrome and firefox.

    Also,

    if I use the actual url with port number it is working fine in IE and safari.

    For example if I directly go to  http://myurl.net:8080/  all the session objects work fine in all browsers.

    But if I go to : http://myotherURL.net/ which is a forward and redirect of above url the session varibles only work in chrome and firefox and does not work in IE and safari.

    I am using Go daddy for hosting and forwarding.

    I am not able to figure this out. Please help any help would be much appreciated.

    Thanks in advance

    </div> </div> </div>

    Thursday, July 2, 2015 1:14 PM

Answers

  • User281315223 posted

    It's important to remember that Session variables are stored at the application-level and as a result of this, they generally will not persist across different applications. So if your two applications are being run on different servers or within different application pools, this could be an issue.

    You might also consider using Cookies to persist your values, you could simply generate a cookie within one of your sites and explicitly check for the cookie and read it within your other one. This is an extremely common approach to handling this type of behavior.

    Additionally, if the data that you are passing along isn't significant or a large amount of data, you could also simply pass it across as a querystring parameter.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 2, 2015 2:43 PM

All replies

  • User281315223 posted

    It's important to remember that Session variables are stored at the application-level and as a result of this, they generally will not persist across different applications. So if your two applications are being run on different servers or within different application pools, this could be an issue.

    You might also consider using Cookies to persist your values, you could simply generate a cookie within one of your sites and explicitly check for the cookie and read it within your other one. This is an extremely common approach to handling this type of behavior.

    Additionally, if the data that you are passing along isn't significant or a large amount of data, you could also simply pass it across as a querystring parameter.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 2, 2015 2:43 PM
  • User295590651 posted

    Apparently this seems to be P3P policy issye because if go to "Web page privacy policy" on IE and chnage setting to "Accept all cookies" for the particular website. It works fine.

    Can I write a code  so that when user login using IE it automatically defaults to "Accept all cookies". Please advise i am pretty new to this. Any help would be much appreciated.

    Thursday, July 16, 2015 4:24 PM