Classic ASP Cookie wont expire - asp-classic

My DOT NET application is calling a classic asp page (say root/folder1/ABC.asp) which in turn call this following piece of code (i.e. user-Agent is my DOT NET Application).
Response.Cookies("TestCookie") = ""
Response.Cookies("TestCookie").Expires = Date() -1
Response.Cookies("TestCookie").Path = "/"
when i navigate to following pages, i still see the "TestCookie" in fiddler:-
root/folder1/1.asp (These requests are originating in the browser.)
root/folder2/2.asp
Environment : Windows Server 2008 R2 IIS 7.
Any suggestions??

Update: I found the solution. Finding since Posting the Question: It seems like that problem is due to the User-Agent. First, i manually made the request (which comes from DOT NET App) in the IE, it just worked fine and expires the cookie.) So i created an IE instance in my DOT NET app which was able to access IE cookie-store and expire

Related

Part of DOM is deleted in ASP.NET 2.0 app on IIS 10

I have an old application built with .NET Framework 2.0 hosted on a server with IIS 10. While using it, some (random) pages are not displayed properly (some scripts aren't executed), and when I check the console there is an error about some undefined function or variable inside a script tag. Apparently, a function call, a variable name, or sometimes a random 2-3 characters in the script are deleted. For example, below is the part where the name of the function gets changed in only one incident while using Chrome:
new searchandler ('sig_policy_EDITOR_sig_policy_323_EDITOR_Fransh'
whereas everywhere else it's alright:
new search_handler ('sig_policy_EDITOR_sig_policy_323_EDITOR_Fransh'
(notice the missing _h in search_handler).
There's another example, this time it happens on Firefox, but nowhere else:
fields : [{name:'Title',nocomplete: ue,readonly:true,searchmode:0}]
fields : [{name:'Title',nocomplete:true,readonly:true,searchmode:0}]
(notice the missing tr in nocomplete:true).
This doesn't happen on IE or when the app is started on different Servers. This only happens on the production server in Chrome and in Firefox. I've also checked what is served before going through IIS, there's no such problems, everything is fine until the pages are opened on a browser. Emptying the cache or sometimes reloading the page fixes the problem, but it gets really annoying when it happens frequently.
According to your description, I have seen similar problems to yours on stackoverflow, you can refer to the following threads:
Response body missing characters
Response from httpHandler is randomly missing characters on client
It is recommended that you can further diagnose based on network captures performed on the server browser and client browser.

Strange double postback in asp.net because of IIS setting

I have the follow problem. There is an asp.net application running on 5 different servers. On most of them everything is normal. Each page is doing single postback before rendering the result. On only one server we faced very strange problem. The page is rendered with the single post back, but after that, there is another second postback call even the html result is already displayed in the browser. I believe it's because of IIS configuration, but it's my first time facing such thing. Please advice if you have any idea. Always there is a solution to reinstall the fifth server but we won't know why.
Unfortunately the code is the same on all of the servers. Also they are working at same platform (windows server 2008 r2 + IIS 7.5). It could not be because of bad html syntax. The other servers work perfect. The fifth server is still not re-installed, but may be this will be the solution. We've already spent a lot of time searching for the answer, but it looks as strange as it is. I'm not sure if I successfully described it. The additional post back is not a real post back, because the html is rendered, the page is displayed, but the debugger goes one more time through the code. Otherwise nothing else happens. I wonder why the debugger will go again through the code as it won't change anything on the client side. Because on the browser side it seems as the request is finished, the result is received and everything displayed on the page. If you're not debugging it with VS, you won't find any difference - all the 5 servers looks as working equal. If the problem is not a setting in the IIS, it could be a setting in the VS, but which one and why???

Default page links not working in IE 10 on one server but working fine on other with same configuration

i have deployed my application from IIS 6.0 to IIS 7.5. the website links does not work in IE 10 from Prod but from uat the website is accessible. both the server are same.
Does anyone know why this is happening in only one server and not the other. Do i need to change some setting in IIS or config file. I am getting the error of
SCRIPT5007: The value of the property '__doPostBack' is null or undefined, not a Function object
Can anyone please help i am facing this issue on production.
"There is a bug in the browser definition files that shipped with .NET 2.0 and .NET 4, namely that they contain definitions for a certain range of browser versions. But the versions for some browsers (like IE 10) aren't within those ranges any more. Therefore, ASP.NET sees them as unknown browsers and defaults to a down-level definition, which has certain inconveniences, like that it does not support features like JavaScript."
http://www.hanselman.com/blog/BugAndFixASPNETFailsToDetectIE10CausingDoPostBackIsUndefinedJavaScriptErrorOrMaintainFF5ScrollbarPosition.aspx
Maybe that could be it?
Thought I'd share for posterity since every page on the internet links to the browser files issue.
This can also be caused in some cases by a change in the .Net Framework 4+ where encoding the __doPostBack encodes a single quote (it did not do this in 3.5).
I was able to fix a LinkButton with that error by manually putting the __doPostBack into the OnClientClick, overriding the href and not encoding a single quote. Granted, maybe not clean, but it worked for me.
http://www.blakepell.com/asp-net-4-5-1-linkbutton-the-value-of-the-property-__dopostback-is-null-or-undefined-not-a-function-object

cd_link.PageLink GetLinkAsString(...) causing pages to fail every other request

I am currently migrating from Tridion R5.3 to Tridion 2011. I am having issues with serving some pages through the presentation server. For reference all of my web pages are classic ASP and I am running them on IIS7.5.
I have have a page located at http://www.example.com/widget/index.asp. When I first access the page I get a The page cannot be displayed because an internal server error has occurred., if I then refresh the page it loads fine, if I refresh the page a third time it comes up with the error. The page works every other request.
I have enabled Failed Request Tracing on my website and I am getting the error
ASP_LOG_ERROR
LineNumber: 87
ErrorCode: 800706be
Description:
Note there is no description.
The code being called is
85: Dim objTranslationPageLink
86: Set objTranslationPageLink = Server.createObject("cd_link.PageLink")
87: strTranslatedPageLink = objTranslationPageLink.GetLinkAsString("tcm:0-12-1", "tcm:12-123456-64", "", "", "TranslationFound", False)
88: Set objTranslationPageLink = Nothing
It looks like there is no problems creating the cd_link.PageLink object, just when calling the GetLinkAsString(...) function.
I use the cd_link.PageLink object in lot of other pages with no problems but it seems with pages that use this specific piece of code experience the problems.
I was thinking it could be something to do with caching pages however I turned off caching of ASP pages (IIS7 > ASP > Services > Caching Properties) and still had the problem.
Any ideas?
edit1
The code worked fine on Windows Server 2003 IIS6. I am trying to make it work on Windows Server 2008 IIS7.
edit2
It appears that the page is creating a lot of cd_link.ComponentLink and cd_link.PageLink objects. I have a test page in which I create 10 ComponentLink objects I get the error (every other page) but if I reduce this to 5 ComponentLink objects it works every time.
edit3
My cd_core.xxxx.xx.xx.log has the following errors
2012-11-02 11:55:34,027 ERROR XMLConfigurationReader - Error while validating file 'cd_link_conf.xml' with schema 'schemas/cd_link_conf.xsd'. cvc-complex-type.3.2.2: Attribute 'DefaultRootLocation' is not allowed to appear in element 'Publications'.
edit4
Thanks for bearing with me. The problem I was having with my cd_link_config is fixed and doesn't appear to have been be related. I now have no errors in my any of the four log files (cd_core, cd_deployer, cd_monitor, cd_transport) but the original issue persists.
Looks like you are running the CD Link windows service and the following hotfix might help to resolve your issue. I have not tried this hotfix but the description says Page link fails on second attempt of accessing the page, so that means it might work sproadically depending on the logger memory resources.
Anyway worth looking at this hotfix : CD_2011.1.0.78355
Description: The Linking windows service was not correctly cleaning up a logger memory resource on certain windows platforms
It is a long time since I worked with Classic ASP and SDL Tridion, but double check the following
Is the linking service running on the server?
Check your cd_licenses.xml file is in place
Validate that you have a correct cd_link_conf.xml and cd_storage_conf.xml (these changed from 5.3 I believe)
Look in the Application and Tridion event logs for clues
The Tridion linking log files
That error code seems to imply that the Linking DLL is not registered properly.
That is all I can think of for now.
I didn't realise that 2011 actually schema-validates the config files, but in any case, now the error is clear. I'd suggest doing the validation yourself in an XML editor such as XML Spy. That should point out exactly what's wrong with the configuration file.
To routinely check your configurations, you may find it interesting to script it as described here.

Problem with Default Document and IIS7.5/Windows 7

I'm having a problem with a component used in a Sitecore solution on our Windows 7 workstations that is driving me batty.
In short, the component in question adds <script> tags to the page that load supporting JavaScript files. The src attributes are set to something like:
/path/to/scriptgenerator/?r=1234&p=asdf
Those paths are not working - I'm getting a 404 back.
You might thing "oh ... well, the path doesn't exist." But it does, and it also has a Default.aspx page in it. In fact, if I try the following path, the JS is generated and returned by the server:
/path/to/scriptgenerator/Default.aspx?r=1234&p=asdf
We're testing the site using IIS7.5, not Visual Studio's debugging web server. Of course, on the production machines, which are Win Server 2008, things work just fine.
The component in question is a third-party component and I have no access to the source code, so I can't just modify it to append default.aspx to the SRC path.
I have checked to verify that Default.aspx is set up as a default document for the site, and it is.
I tried to work around the problem using ISAPI_Rewrite, but for some reason, rules that I set up for /path/to/scriptgenerator are ignored.
I've tried the solution described in these questions, and that has no effect on my problem:
IIS 7 Not Serving Default Document
ASP.NET 2.0 and 4.0 seem to treat the root url differently in Forms Authentication
I'm really not sure what to try or look for next ... any suggestions?
Is this component set up within the same IIS Site as the Sitecore application?
If so, have you added path /path/to/scriptgenerator to IgnoreUrlPrefixes setting in web.config?

Resources