Avoiding Cookies While Requesting Static Content?

May 31, 2010

I just did an audit of one of my web application page (built using ASP.Net and running on development server) using Google chrome's developer tool. One particular warning caught my eyes:

Serve static content from a cookieless domain (5)!

Here is my screen shot [URL] as well. I would like to know is it possible to avoid cookies for these kind of requests. I see that there is no cookie requests for javascript files as well. I it possible to avoid cookies in the header for these files as well? and why didn't the browser attach cookies for javascript files and attach for CSS and image?

View 1 Replies


Similar Messages:

Two Redirects Both Pointing To The Same Content Page - When Requesting /example It Gives A 404 Page?

Jan 15, 2010

I have inherited a site that was developed with a very over architedcted Content Management System. I am having problems now with the redirection functionality built into it.

This is on a dedicated Windows 2003 server running ASP.NET 3.5 sp 1. The redirects are stored in the database, and I have confirmed that the correct redirect is in place in the database. Finally, the file extension .html has been mapped in IIS to the ASP.NET ISAPI. And there is an HttpHandler created to redirect the .html requests. The default documents on the server, in order, are:

default.aspx
index.aspx
default.asp
index.asp
default.html
index.html

for this example, we have two redirects both pointing to the same content page. /example and /example.html.when requesting /example.html it correctly finds the appropriate redirect in the database and does its magic. Bueno. When requesting /example it gives a 404 page. Its not even the asp.net yellowish 404 generic error page. Its the standrad vanilla IIS 404 response so it appears that asp.net is not intercepting these requests.

View 3 Replies

MVC :: Static Content Returns A 500 Error?

Nov 16, 2010

I think I might be missing something obvious but I'm not sure. The other day I was trying to run throught the windows live ID domain verification process on my asp.net mvc site. Part of the process requires you to download a text file and put it in the root of your site which your domain points to. When I would click the verify button in the windows live app verification process it would fail. In a browser, I could hit the request the text file and get a 200, which puzzle me. I then used this site http://www.internetofficer.com/seo-tool/redirect-check/ to check for any redirection issues. Suprisingly when I enter in the url to check, in my case http://www.whatitcoststobeme.com/741KXPjf42zgZRnV6O1LsO92.txt, it returns a 500 error. I ran this same test against a non-MVC site and the verificaton process passed plus the redirection checker return a 200 ("direct link" on their site). The environment this was tested in was IIS7.

why this is happening with static content on a ASP.NET MVC site? I want to say it's something to do with the url routing handlers.

View 6 Replies

MVC :: Put View-specific Static Content (img/js)?

May 26, 2010

so I see these opinions/tutorials about serving static content to support views, from files that co-reside in directories with those views:http://forums.asp.net/p/1258895/2347379.aspx#2347379http://haacked.com/archive/2008/06/25/aspnetmvc-block-view-access.aspxIn the second article, Phil says view-adjacent static content was default-enabled at the time (over a year ago). Unfortunately, though, I reference:

[Code]....

and by default ASP.NET is trying to find it adjacent to my view, which (voila!) is disabled by default. Grr. :)What is the out-of-box IDE-assisted way to reference view-specific static content that doesn't require hardcoding directory tree structures into my path, and also doesn't require ALL of my assets to be in a single folder?Or, if I do it the "unpure" way like I'll probably do if I don't get other ideas (by modifying /Views/Web.Config HttpFileNotFoundHandler), should I block anything unsafe besides .ASCX, .ASPX, and .MASTER that is likely to show up in my views folder?

View 8 Replies

Pages Showing Different Static Content?

Oct 10, 2010

I have two aspx pages that both use the same master page. Master page is more or less the default from VWD 2010 web application (Site.Master).

So both page A and B have the same:

[Code]....

The difference when shown in web browsers is (tested on Chrome and Firefox) that PageB looks like it has one more blank row/space on top of the page. How is this possible?

View 2 Replies

Iis7 - Serving Static Content From A Subdomain Using URL Rewrite

Feb 24, 2011

I have a domain which is receiving quite a few hits per day and have been asked if I can serve the static content from a subdomain. As the site is quite extensive and already written, I was wondering if there is any way I can use URL rewriting to change:

www.example.com/image.gif
to
static.example.com/image.gif

I have a solution which works using 301 redirects but from what I understand, this is counter productive as 2 requests will have to be made per image. I don't really want to go through all the aspx pages and css to hard code the new url as it will cause problems further down the line - some parts of the site are still being developed and static content could change at any time. I tried using rewrite (as opposed to redirect) to change the url but it came out something like:

http://www.example.com/http://static.example.com/image.gif

How would you achieve this? I have full access to dns and the server (win 2008r2 / IIS 7.5) so can make any changes if url rewriting is not the answer.

View 1 Replies

Javascript - How To Get And Set Cookies / Getting Different Values For The Cookies In Different Pages?

Aug 17, 2010

I'm handling cookies using JavaScript to store some values in my asp.net web application.I use document.cookie to save some values (converted into a lengthy string). But i want that value to be accessible across all the pages in my application.When i try to get that value from a different page, i get the values pertaining to the document in the current URL.

In short i save the value in the cookie in http://myapp/doc1.aspx and want to retrieve it in http://myapp/doc2.aspx

So is document.cookie is pertaining to a single document scope? How can i save/read cookies across the site?

Update.This is how i get and set cookies

function getCookie(c_name)
{
try{ [code]...

But i'm getting different values for the cookies in different pages.

View 2 Replies

Respect "Serve Static Content From A Cookieless Domain" Page Speed Rule In IIS6?

Nov 5, 2010

How to respect "Serve static content from a cookieless domain" page speed rule in IIS6?

View 3 Replies

C# - Is It Safe To Access .net Session Variables Through Static Properties Of A Static Object

May 10, 2010

Is it safe to access asp.net session variables through static properties of a static object?Here is what I mean:

public static class SessionHelper
{
public static int Age
{
get
{
[code]...

Is it possible that userA could access userB's session data this way?

View 2 Replies

Requesting Response From An Aspx Url In Xmlhttprequest

Feb 22, 2011

problem in requesting response from an aspx url in xmlhttprequest...

xmlhttp.open("GET","a.aspx",true);

View 2 Replies

C# - How To Lock A Private Static Field Of A Class In One Static Method

Mar 26, 2011

I have a private static field in my Controller class in an MVC web application.

I have a static method in that controller that assigns some value to that static field, I want to apply lock on that static field until some other instance method in the controller uses the value stored in the static field and then releases it.

DETAILS:

I have a controller named BaseController having a static ClientId field as follows and two methods as follows:-

public static string ClientId = "";
static void OnClientConnected(string clientId, ref Dictionary<string, object> list)
{
list.Add("a", "b");
// I want the ClientId to be locked here, so that it can not be accessed by other requests coming to the server and wait for ClientId to be released:-
BaseController.clientId = clientId;
}
public ActionResult Handler()
{
if (something)
{
// use the static ClientId here
}
// Release the ClientId here, so it can now be used by other web requests coming to the server.
return View();
}

View 1 Replies

AJAX :: Calling Non-static Methods From A Static Method?

Jun 30, 2010

I did some research after posting. All I found was simple examples for no-layer architectures, like connecting to a database from your aspx page, so, in a corporate environment, it is unnaceptable.

I need to call a server-side method (using ASP.NET Ajax) in a 3-layer architecture.

For example, my Default.aspx contains a method LoadProducts().

[Code]....

[Code]....

This cannot change. There is no way to convert Business and Data layers to static.

How can I call the LoadProducts() method using ASP.NET Ajax?

View 2 Replies

How To Request A Resource Without Requesting A WebPage In Application

Jan 8, 2010

We have a Web Application (WebApplication A) which is in place and serving fine, we are working on another WebApplication which will use the Engine of Existing Web Application (WebApplication B) to some extent.

Problem: WebApplication A responds when a http request is made for a resource, like LatestPost.aspx, which passes it down to relevant class / Module like FrontManager.cs. I want to know how can we access that Module / class (FrontManager.cs) from WebApplication B, without requesting a Web Page ?

View 2 Replies

Soap - Is There Any Way To Get The Requesting User's ID In A Web Service Method

Apr 30, 2010

I know this probably isn't possible, but I would like to be able to get the Request user ID from within an ASP.NET web service method. So far, I've tried User.Identity.Name, Context.Request.LogonUserIdentity.Name, Request.ServerVariables["AUTH_USER"] and Request.ServerVariables["LOGON_USER"]. Am I tilting at windmills here, or is there something super simple that I'm missing?

View 1 Replies

C# - How To Use Query String To Find Requesting Page

Mar 6, 2011

I have a page signup.aspx where user can register, how this page will find from which page request came from and how it will redirect user after registration to the requesting page, i want to do this using query string but don't know how PLZ SHOW ME CODES.

View 2 Replies

Security :: Set And Send Back To Requesting Page?

May 6, 2010

I made a custom MembershipProvider to work with Oracle and my own database schema. I also have my own layout of controls and am not using the built in ASP log in controls. I don't even want to use it templatized. Reason being is that I don't want to show all those controls on one page.I want on the top of every page on the siteUsername textbox Password textbox Sign In button Register buttonI created a register form as the first step of trying out my provider. Everything has landed in the database correctly.Now my problem is that when a user clicks the Register button from any page, I need to note what page is requesting the registration form and then send them back when registration is complete. The built in controls seem to automate this behavior, but I do not know how to do it myself.So question is: How can I program the site to remember what page a user came from when clicking a register button, then send the user back when registration is completed?

View 3 Replies

Avoiding Comma Separator For The Last Value?

Jan 18, 2011

I am generating an output on a webpage in a format like this

({"1":"Jeff","2":"Tom","3":"Michael",})

For this, basically this is the code I am using

Response.Write("(" + "{");
//
for (Int32 i = 0; i < k.Length; i++)
{
Response.Write(Convert.ToString(k.GetValue(i)) + ",");
}
//
Response.Write("}" + ")");

Notice my output, after Michael" there is a comma which I do not want since this is the last vaue but this is appearing since , is in the for loop. How to prevent this/remove this last comma from appearing?

My output should be ({"1":"Jeff","2":"Tom","3":"Michael"}) (There's no comma after last value here)

View 8 Replies

Web Forms :: How To Use Query String To Find Requesting Page

Mar 6, 2011

I have a page signup.aspx where user can register, how this page will find from which page request came from and how it will redirect user after registration to the requesting page, i want to do this using query string but don't know how SHOW ME CODES.

View 6 Replies

Security - Avoiding Session Hijacking?

Feb 24, 2011

I recently read an article on making ASP.NET sessions more secure here and at first it seems really useful.

Previously I had been storing the user's IP address in the session, then making sure in every subsequent request that the requesting IP was equal to the stored IP.

The code in the article also protects the session by checking the IP address, except it stores a hashed message authentication code containing the user's IP as part of the session cookie. It creates a hashed MAC twice every request, which I imagine would slow things down a little.

I can already see a potential flaw in their code: if you were to somehow get a hold of the key used to generate the MAC, you could then generate a valid MAC with your own IP - you wouldn't even have to fake the IP the session was started on.

It seems like an overly-complex solution to a simple problem which not only incurs a larger overhead but also is more susceptible to attack than the trivial method - unless I'm completely missing the point.

So, why would this approach be any more secure than the more simple approach that I had been using?

As a slight aside, the author also states that you shouldn't use the whole IP address in the comparison, as some user's IPs change every request if they are behind a proxy. Is this still the case if you check X_FORWARDED_FOR?

View 1 Replies

Avoiding Application Pool Warmup In IIS?

Jan 31, 2011

I'm having issues with an ASP.net site (framework 3.5, IIS6 ) having very slow 'first hit' response times. I'm guessing that the issue is to do with the app pool recycling and having to warm up.

I got to thinking. As part of the site I have a HTTP module that spins up a 'never ending loop' on a separate thread which periodically (every 5 seconds) calls an sproc on SQL to make sure the database is still there. I'm wondering if a similar approach might work to get the site to make an HTTP request to "itself" as a keep alive.

My question is, before I go and do this, can anyone think of any reason why it won't work? For example, something like "oh no... ASP.Net will figure out that you're playing with yourself and not go through the whole page lifecycle... etc etc".

View 1 Replies

AJAX :: Avoiding Postback Using Updatepanel?

Sep 24, 2010

avoiding postback using updatepanel

View 4 Replies

Avoiding Submit On Click Of ENTER?

Feb 19, 2010

I have a button in my page. If i click enter in the page the button click event is getting fired. How can i avoid this?

View 9 Replies

Web Forms :: Show Popup Over The Requesting Page When Called From Commercial App?

Jan 3, 2011

I use a commercial web application that has the ability to use web triggers in order to do additional validation prior to saving its forms. The commercial web application simply makes a request out to whatever asp, php, etc. code that you've written... and in the case of asp.net I've validated forms by pulling variables off of the page.request object and then passed back a success/fail message to the commercial app using JSON.

I would like to use asp.net to display a modal popup control when called, in order to display some options. Because I would be triggering this code from a commercial web app, I'm wondering how I can display the popup control on top of the requesting page? The code I've currently written displays a blank page with my popup control on it. Is it possible for me to display ONLY the popup control when called from another website?

View 1 Replies

Best Way To Prevent Visitors From Excessively Requesting Resource-consuming Pages?

Dec 22, 2010

I am a newbie and trying to develop a Yellow-Pages like portal using ASP.NET MVC. I am wondering there will be some bad visitors who excessively request the portal pages to slow down my portal and to block request from other legitimate visitors. My current idea is put a nugget (an embedded code block) in master page to check the interval between two consecutive request. If the interval is less than 5 seconds (for example), I will reject/terminate to render the request.

My question:

What is the best way to handle this issue? If my idea above is applicable to solve this issue, what function must I call to terminate the rendering process (before doing resource-intensive job)?

EDIT 1:

Can we set this on server (IIS settings) globally instead of per application basis?

View 3 Replies

C# - Identify From HttpContext Object That Requesting Application Or Browser Is Cookieless?

Dec 30, 2010

How can i identify just from the HttpContext Object that the HttpRequest coming to my application is from a cookieless application or cookieless browser?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved