I am using lot of session variables in my website, some of the session variables does not work in redirect in IE because the browser is not set to accept all cookies for the website.
How can i make client browser to accept all cookies for my website.
You cannot force the client's browser to do anything is isn't set to do. IE *and other browsers* have a limit on how many cookies, the max size of each cookie, and for some, the total size of all those cookies, that will be accepted from one domain before
they no longer accept a new cookie.
According your description, the session variables does not work in redirect in IE. Actually IE does a lot of client side caching, and would not retrieve a page which is in the current cache. You can add these lines to your page load event:
besides the options provided here by others you might also want to take a look into cookiess session state (https://msdn.microsoft.com/en-us/library/aa479314.aspx#cookieless_topic2).
Basically it adds another string in your querystring that can be identified by ASP.NET to track down the session for that user.
Grz, Kris.
Read my blog | Twitter Working with Azure, chatbots, ASP.NET MVC, Web API, EF, MS SQL, ...
Keep the forums clean: report to the moderation team!
Though a cookie is needed to identify the session itself, other than that session variables and cookies are unrelated. I would search in another direction (and to start with would check if I keep using the same session).
None
0 Points
7 Posts
code for browser to accept all cookies for website
Jul 16, 2015 04:43 PM|sagrawal0008|LINK
Hi,
I am using lot of session variables in my website, some of the session variables does not work in redirect in IE because the browser is not set to accept all cookies for the website.
How can i make client browser to accept all cookies for my website.
Please advise.
Regards
Contributor
5961 Points
2467 Posts
Re: code for browser to accept all cookies for website
Jul 16, 2015 05:16 PM|KathyW|LINK
You cannot force the client's browser to do anything is isn't set to do. IE *and other browsers* have a limit on how many cookies, the max size of each cookie, and for some, the total size of all those cookies, that will be accepted from one domain before they no longer accept a new cookie.
See this link for tests and results on this: http://browsercookielimits.squawky.net/
Your option is: Don't exceed the limits. Use a different method to store your variables.
Member
290 Points
59 Posts
Re: code for browser to accept all cookies for website
Jul 17, 2015 03:00 AM|Candy Zhou|LINK
Hi sagrawal0008,
According your description, the session variables does not work in redirect in IE. Actually IE does a lot of client side caching, and would not retrieve a page which is in the current cache. You can add these lines to your page load event:
Best Regards,
Candy Zhou
All-Star
191741 Points
20952 Posts
ASPInsiders
Moderator
MVP
Re: code for browser to accept all cookies for website
Jul 17, 2015 03:06 AM|XIII|LINK
Hi,
besides the options provided here by others you might also want to take a look into cookiess session state (https://msdn.microsoft.com/en-us/library/aa479314.aspx#cookieless_topic2). Basically it adds another string in your querystring that can be identified by ASP.NET to track down the session for that user.
Grz, Kris.
Working with Azure, chatbots, ASP.NET MVC, Web API, EF, MS SQL, ...
Keep the forums clean: report to the moderation team!
All-Star
48530 Points
18075 Posts
Re: code for browser to accept all cookies for website
Jul 24, 2015 04:10 AM|PatriceSc|LINK
Hi,
Though a cookie is needed to identify the session itself, other than that session variables and cookies are unrelated. I would search in another direction (and to start with would check if I keep using the same session).
Try perhaps http://weblogs.asp.net/bleroy/Don_2700_t-redirect-after-setting-a-Session-variable-_2800_or-do-it-right_2900_