cookies

PHP: Cookie problem

Can anyone tell me what is wrong with my code? <?php class MyCookie { private $expiration = 0; private $path = ""; private $domain = ""; private $secure = false; private $httponly = false; private $names = array(); public function __construct($e, $p = "/temp/", $s = false, $h = false) { $this->expira...

Do some browsers encode cookies?

This is sort of a follow-up to http://stackoverflow.com/questions/2329395/why-are-my-cookies-containing-json-occasionally-malformed, which we have resolved. I have a 3-value cookie, and we're url encoding the main value. The other two values are a timestamp and a hash. It looks like this in our response header: foo=d=634027688530013...

[Firefox Development] Creating an addon to override cookies

I'm working on writing a plugin to change the value of a cookie to prevent log out. I was planning to have it so that on every page load the value of that cookies is changed to my value. Is this the best way to go at it? Is it safe? I'm mostly needing to know how other developers would go at it and what are the pit falls of my current id...

PHP cookie problem - www or without www

Why is it that if I create a cookie on www.example.com and check it on example.com, the cookie doesn't exist there? I am planning to just use .htaccess redirect non-www to a www domain. But how do I solve this? ...

uiwebview session problem

NSURL *url = [NSURL URLWithString:@"http://ip/login"]; NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL: url]; NSString *body = [NSString stringWithFormat: @"name=%@&pass=%@", @"phpxiaoxin", @"86f7e437faa5a7fce15d1ddcb9eaeaea377667b8"]; [request setHTTPBody: [body dataUsingEncoding: NSUTF8StringEncoding]]; [request ...

Cookies are not working on a php session file:

I tried the following: Basically, it should say: If there's no cookie, get lang from web browser (this part works and that's the job of lang.php). If there is cookie, the session will take its value from the cookie. If there's nothing, leave it as English. session.php: /* Class constructor */ function Session(){ $this->time = t...

nginx + vbulletin cookie problem

Hello. I installed a forum vbulletin 3.8.4 .. When trying to load my apache is not set cookie 'userid' and 'password'. Although other cookie 'bblastactivity', 'bblastvisit', 'bbsessionhash' sets .. Help please ...

Persisting data in cookies - ASP.NET

I find persisting data in the Session really useful, however, by nature it expires when the browser is closed (cookie with expiry set to clear at end of session). I especially like how it is written transparently so i dont have to worry about auth-ing the user or generating any unique id's. My question is, is there something in the .ne...

Using HTML from bundle to save cookies in UIWebView?

So I have a web page inside my bundle, which I load in a UIWebView. However, the page doesn't seem to be able to store any cookies, even though other (online) websites can. How do I get it to store my cookies? ...

Limiting ASP.Net cookies to application

I have two applications on my webserver. myserver.com/ApplicationA myserver.com/ApplicationB Both applications are using similar codebases and so there are several overlaps in their cookie names, which are causing problems... I'm aware that it is possible to limit a cookie in ASP.Net so that only applications on a certain "Path" can ac...

Is it advisable to store a hashed password in a cookie?

I want user's to be able to select a "remember me" box on my website so they need not log in each time they come. So, I need to store a unique ID in a cookie to identify them. Is it safe to hash their password with sha512 and a long salt in PHP and store that value in the cookie? If the cookie was stolen, would their password be at risk?...

FireFox 3.6 for Mac not reading cookie / redirecting properly

Hello, I have a nifty little cookie-based home page redirection scheme going for my website. Basically, the first time a user browses to the website, they are presented with two choices (Products vs. Machining Services). When the user clicks one of the two buttons, a JavaScript function stores a cookie with the appropriate choice ("pr...

'Remember-me' authentication feature, does it always mean 'Unsecure' Website?

Hi all, I'm considering to implement the classic 'remember-me' checkbox on my webapp to allow the authenticated user to be 'remembered' once he returns to visit my website. Gmail, Facebook and others have this kind of feature but I'm not too sure how secure it can be. A Java Framework like Spring Security uses an 'Hash-Based Token App...

Is it possible to change the value of a cookie and leave the expiration date the same in PHP?

Say I have a PHP script that creates a cookie that expires 10 days from now. Is there any way to use PHP to update the value and maintain the same expiration date? For example, say my cookie is created today with a value of "foo" and expires on 3/13/10. Two days from now, I want to change the value to "bar". Can I still have the cookie...

How to Destroy NSHTTPCookies ?

I am running a Post call to a URL and logging into a system. This is working, but after the login, I am attempting to retrieve the cookies – but when I do this: NSArray *allCookies = [NSHTTPCookie cookiesWithResponseHeaderFields:[response allHeaderFields] forURL:[NSURL URLWithString:mywebsite"]]; NSLog(@"How many Cookies: %d", allCooki...

Junit - Adding cookies to UrlResource ( or alternative )

Hi We are using JUnit+Selenium for functional testing of a web site in our project. In several tests we need to download files from the website and compare it with a local resource. We are using UrlResource to do this. UrlResource actualResource = new UrlResource(URL); compareUtil.isResourcesEquals(expectedResource, actualResouce); ...

HttpWebRequest sessionID c# login

Im trying to login to a website (www.vodafone.ie) with a console app and c# httpWebRequest. Problem is it works ok about 50% of the time. Im using fiddler to find out the GET and POST requests I need to make. Done that and my app is successfully recreating these as best as I can see. The steps are; 1) GET request with cookie container ...

ASP.NET MVC persistent data and code organization

I'm giving MVC another shot, and I feel like I'm learning freakin' HTML all over again. So, stupid question: At the top of my master page, I've got a partial view (or similar - I'm using the string template view engine and so far I love it) which either displays a small login form (similar to what NewEgg has), or a message like You are...

cookie name is truncated in Servlet 3.0 HttpServletRequest (Glassfish V3)

I'm porting our Web authentication/authorization middleware for use in containers implementing the new servlet 3.0 API (Glassfish V3 in this case). The middleware pulls cookies from the HttpServletRequest filtering on cookies with names of the form "DACS:FEDERATION::JURISDICTION:username". This works fine in the version 2.5 servlet API ...

Why won't the .ASPXROLES cookie pass through subdomains?

I have tried to set up .Net authentication to allow authentication across subdomains in my app. To do this, I added a "domain" attribute in the forms element, like this: <forms domain=".mydomain.com" name=".MyApp" loginUrl="Util/login.aspx" timeout="120" /> Then, for the role provider, I added a domain to that too: <roleManager doma...