cookies

Facebook Connect & HTTP Cookies - How Can I Overcome this "Race Condition"

If you're wondering what the "Race Condition" is, its a flaw in a system whereas it's highly dependent on timing. See the wiki here for more info. So, the condition i have is relating to Facebook Connect and implementing a Single-Sign-On service with an ASP.NET 4.0 Web Application (Forms Based Authentication - IIS7). The process itself...

Overwrite cookie failed PHP & ASP cross subdomain

I have problem in overwriting cookies value cross sub domains, a website running in ASP which is in www.domain.com and mobile site running in PHP with m.domain.com sharing same cookie Cookie created in www.domain.com via asp as follow: Response.Cookies("cookie_name")="value1" Response.Cookies("cookie_name").Expires=DateAdd("m", 1, Date...

Assigning a variable to a cookie.. no wait! The other way around...

I would like to assign a cookie to a variable... e.g. var aVariable = $.cookie("moo"); I am using the jQuery cookie functions - do I need to set the cookie AND set the variable at the same time or something? Help pretty please! ^.^ My Code: function goBackToPosition() { var xPos = $.cookie("yourPositionX"); var yPos = $...

ASP .NET Custom RoleProvider not resepecting cacheRolesInCookie="true"

I've implemented a custom role provider, and configured it in my web.config file like this: <roleManager enabled="true" defaultProvider="TDRoleProvider" cacheRolesInCookie="true"> <providers> <clear/> <add name="TDRoleProvider" type="TDRoleProvider"/> </providers> </roleManager> I've overridden the GetRolesForUser function...

How do you append for example ?lang=en_US to the url based on a cookie containing country code?

Hi. I have a code like this that extract the country code saved in the cookie. if (isset($_COOKIE['country'])) { $country = $_COOKIE['country']; $language = "eng"; if ($country == "NO"){ $language = "nor"; } ...

ASP.NET: Reques cookies have null for domain?

When I examine my HttpContext.Current.Request.Cookies collection, some of my cookies have null for their Domain member. Why/when is a Domain null? ...

ASP.NET Cross-Domain Cookies & Facebook Connect

Hi All, I have a website which i integrate with Facebook (via FBML - JavaScript API). I have setup the application on Facebook as per normal, specifying the "Connect URL" to be the domain of my website. However, my application has multiple bindings in IIS for the same website. Such as: www.bar.com.au foo.com.au The domain...

Cookie Issue. Redirecting from trusted site to non trusted - IE 8 protected mode stays off

Does IE8 have a problem determining what protected mode state the resulant site should be in when following redirects? We are seeing this situation when using IE8 on windows 7 in an enterprise environment. Note: Server A is a secure site and is listed in the users trusted sites list. Server B is also a secure site but is not listed ...

How to check ASP.NET Forms Authentication Status Using Only JavaScript?

The reason i need to do this is because of Facebook Connect - which is another story, so i'll save you the drama for that. =) Anyway, i have this function that runs on window.onload: function userAuth() { SomeFunctionWhichGetsFacebookCookes(); if (!loggedInUsingFormsAuth && loggedInViaFacebook) { window.location.reload(); //...

Alternative to HTTP Cookies?

They say Cookies are bad. I personally believe there should be a "smarter" way to detect the state of a user on a web app. Say, currently this is how it works in a distributed environment where xyz.com has many pools and servers (which i know of): User logs in xyz.com The login module of xyz.com drops a cookie on client's local machin...

Setting Path of Cookies when Spring Webflow is used

How do you refer to a resource(a JSP or any view) to set the path of a cookie when the application is using Spring webflow? ...

Set a cookie to never expire

Looking at the php documentation on setting a cookie I see that I can set an expiration date for the cookie. You can set the cookie to expire at the end of the browser session or at some time in the future but I do not see a way to set the cookie to never expire. Is this even possible and how is this accomplished? ...

Problem with cookiemode and uri-encoded cookies

Hi. In a webapplication I use cookies for authentication. But when the browser or device accesing the webapp does only support uri-encrypted cookies, I get a problem. The normal links are updated by the browser itself, but i have some ajax functions that need authentication too. How can i insert the uri-encoded authentication cookie int...

deleting cookies without leaving the browser !

HEY GUYS deleting cookie is a easy thing to do in php but problem is untill i get out of my browser it still exists setcookie("PHPSESSID", false); setcookie("PHPSESSID","",time()-31536000); any way to delete this cookie whithout need of closing the browser ?! so what do u think ?! ...

HttpCookie is not deleted when session changes or is invalid

I'm creating an HttpCookie, setting only the name and value and not the expires property, then adding it to the response. Simple enough. The cookie is created (but not persisted) as expected. The problem is when the session changes for some reason (like the website was rebuilt, or I rebuilt my app when debugging) then the cookie stays...

How do I set a cookie with a (ruby) rack middleware component?

I'm writing a rack middleware component for a rails app that will need to conditionally set cookies. I am currently trying to figure out to set cookies. From googling around it seems like this should work: class RackApp def initialize(app) @app = app end def call(env) @status, @headers, @response = @app.call(env) @r...

How to set a cookie in php?

Hi, I set a cookie and then check if exist like this if(isset($_COOKIE["fan"])) { //Do Nothing } else { $cookie = "yes"; $expire=time()+60*60*24*30; setcookie("fan", $cookie, $expire); include_once("../inc/functions.php"); echo fan_page(); } When I test on my local machine, it works, but when i upload to production server, it do...

Can My Web App Implement User Login and Remain Stateless?

We have a web application that is stateless. We are using http authentication over SSL/TLS. The user's browsers are presumably storing authentication credentials (possibly even after a browser shut-down if they configure their browsers that way.) We validate them on every access. For reasons mostly having to do with usability, we wou...

php SetCookie works in Firefox, but not IE

Hi All, I have two php scripts test.php <?php header("location: test2.php"); setcookie("test", "8kFL4IZfjkBmV7AC", time()+60*60, '/'); exit; ?> test2.php <?php var_dump($_COOKIE); ?> I then point my browser to test.php which redirects to test2.php. I then get the following results. In firefox, i get the following: array ...

Check if user agreed to terms , set cookie

I'm a Drupal nub. I would like to check on every page if user (anonymouse) agreed to somekind of terms. I suppose i should write small custom module ? Where will this condition be written if(!$_COOKIE('confirm')){ //jQuery show confirmation form //Set cookie for 1hour } maybee in page.tpl.php ? Please, give me some tips .. ...