0

i am stuck in a very bizzare position and its been a month. sometime what happens if any of our client gets an exception or we update some page or session expires that particular user can never access the page (which he/she was using) until and unless he/she deletes browser cache. if we try to access it, asp.net Logs you out and redirect to Login page.

this was happening and still happening on my local computer. i thought this problem occurs only on my local but today a client has reported on live as well.

For example if i got kicked from Pagexy.aspx i cannot access it. If i access it, it Logs out and send me to Login page. i have tried many times by inputting URL or going from hyperlink or button call.

And one more thing after deploying css file. client could not see arrows and they have to press Ctrl + F5 i mean clients do not know these things.

thanks

PS: i have made these videos to explain my point. 1) Session Time out bug (http://screencast.com/t/CW0e4DsH) 2) Rapidly change code and refresh the page (http://screencast.com/t/IKJQmkjU) these videos will give clear idea what is happening.

Kamran Pervaiz
  • 1,861
  • 4
  • 22
  • 42
  • It sounds like you are asking about three different issues. Your question is unclear (and the pleading for help is just cluttering up the post). – TLS Jan 10 '12 at 17:23
  • You are not getting answers because it's very hard to give you an answer w/o you identifying the exact piece of code that is giving you problems or explaining in your question how is your application configured. – Icarus Jan 10 '12 at 17:36
  • Thanks for updating the question - it is better now. SO is a community of people that want to help, so there's no need to plead to get answers. – TLS Jan 10 '12 at 17:57
  • Does it always log you out when you try to access the page again, or can you access the page for a while after logging on again? – TLS Jan 10 '12 at 18:02
  • hi TLS, Yes it always logs me out, the thing is i dont think its a redirection. it just comes to login page Poof. Yesterday one of my client called me and she had the same exact problem and i told her to clear the browser cache. she said she can see the page visitsupplier.aspx fine on other computers but when she tries on her browser its same behavior which i have mentioned. To be quite honest its really vague. – Kamran Pervaiz Jan 11 '12 at 09:06

2 Answers2

0

In your first paragraph, you say that "user can never access the page" without first clearing the browser cache. You then mention that you yourself can access it, but you get redirected to the Login page. The trouble is, that's two very different scenarios, so which is it? Is the user redirected to the Login page as well? What does the user actually see until clearing the cache?

For the sake of this answer, I'll assume that the external users are also redirected to the Login page.

What you're experiencing when you get redirected to the Login page is the built-in security mechanism related to authentication in IIS. You don't mention what kind of authentication you're using, but with Forms Authentication, a secure cookie is created in the browser. That cookie expires after a certain length of time, so the user will be redirected to the login page. Locally, if you refresh a page too many times, IIS dumps/ignores the cookie and requires you to log in again. This is expected behavior.

To your question about CSS, take a look at this question. I think the answer from BalusC is what you're looking for in that regard.

Community
  • 1
  • 1
TLS
  • 3,090
  • 2
  • 25
  • 33
  • Hi TLS, Sorry for the confusion, when i meant i access it. I meant i try to access that page. ok let us take example of my localhost then we will move to live. on my localhost i have experienced this behavior in mostly 3 situations. 1) when Session times out. 2) when there is an exception on the page. 3) when i am changing rapidly, too much change at once. (4) totally random) i am using FormsAuthentication. your comment "if you refresh a page too many times, IIS dumps/ignores the cookie and requires you to log in again" makes alot sense but why i cannot access the page afterwards? – Kamran Pervaiz Jan 11 '12 at 09:14
  • Hi, i have made video and try to show it. first video is for session timeout. http://www.screencast.com/t/CW0e4DsH second video is for rapid change in code http://www.screencast.com/t/IKJQmkjU Exception video i cannot make because i am not sure when it happens but by watching these two videos you will have idea. i hope now you see the problem. – Kamran Pervaiz Jan 11 '12 at 11:34
  • Sorry, but I won't be able to watch those videos where I am now. Be careful when you say "cannot access it," because that really means, "not able to get to the page at all in any way." If you really mean, "get redirected to log on and then can view the page," that's what you should say. Is that what you really mean? – TLS Jan 11 '12 at 15:11
  • hi TLS it actually redirects to Login page. it always does. if you could watch these videos you will have clear idea. there will be no confusion at all. – Kamran Pervaiz Jan 11 '12 at 16:17
0

Guys i have solved this problem by doing some hit and trial of Cache.

i tried with the below code.

Response.CacheControl = "no-cache";
Response.AddHeader("PRAGMA", "no-cache");
Response.Expires = -1;

But it didnt work then i tried below tag but still cannot sort it out.

Solution to this problem is

<%@ OutputCache Duration="1" NoStore="true" Location="None" %>

Duration cannot be 0. but this sorted the issue.

Thank you all.

Kamran Pervaiz
  • 1,861
  • 4
  • 22
  • 42