cookies

Parsing __utmz tracking cookie to get referral

I use Google Analytics on my site, and I want to read __umtz cookie to get referring link. I made some research and I wrote such code: $refer=explode('utmcsr=',$_COOKIE['__utmz']); if(count($refer)>1) $refer=explode('|',$refer[1]); $refer=addslashes($refer[0]); The problem is, this is not always working, sometimes I get junk as result...

Sending cookies using HttpCookieCollection and CookieContainer

Hi everyone, I want to tunnel through an HTTP request from my server to a remote server, passing through all the cookies. So I create a new Http**Web**Request object and want to set cookies on it. Http**Web**Request.CookieContainer is type System.Net.CookieContainer which holds System.Net.Cookies On my incoming request object: HttpRe...

How to receive HTTP cookies from a web server in PHP?

How to receive HTTP cookies from a web server in PHP? ...

How would I go about writing a simple PHP bot?

How would I go about writing a simple PHP bot that could login in and recieve all the cookies sent by the server? ... and then send them back when required? Any suggestions would be appreciated. ...

maintaining state without a cookie

I am trying to figure the workings of an IPB forum. If I tick remember me, then I will remain logged in even if I close the browser and reopen it. I am trying to workout how this is possible, as the only cookies that are set by the server expire at the end of the session, i.e. when I close my browser. So how does the server no how to r...

How to make authkit session cookie HttpOnly in pylons?

Hi there! I use authkit module with Pylons and I see that session cookie it sets (aptly named authkit) is not set to be HttpOnly. Is there a simple way to make it HttpOnly? (By "simple" I mean the one that does not involve hacking authkit's code.) ...

ASP.NET HttpCookie helper class

I have written this utility class to save and retrieve HttpCookies. It seems not to be working, i.e. Cookie is not being retrieved... public class AspNetUtil { private Page _page = null; public AspNetUtil(Page page) { _page = page; } public bool SaveInCookie(string cookieName, s...

Are there any gotchas for the blackberry webapps that use cookies?

Hello, I know I am not giving many details... It is hard to get many details right now... but I am working on a web app, that has a login page, and stores if the user is logged in, in session data, that is linked to cookie data. It works on most devices and computers...but on the blackberries I have tried it on, it seems to lose the c...

PHP Sessions - Warnings

I asked the question "php warning - headers already sent after server move" yesterday and I have made changes since to try and fix the problem but im still not getting it! I am working on code that has been made by another company! Im not moving the site off their server and putting it on ours but the my problem is that sessions are not...

Login to a site and then POST to a page in it

I have to login to a page using three parameters, after that I have to POST two parameters to another page inside the site I've just logged in. So far I've got a cookie with this: curl -c cookie.txt -d "username=username&pwd=pwd&domain=mydomain" http://myurl ...inside of the cookie I have a JSESSION id. I use the cookie as follows: ...

Should PHP session be created before login or after successful login

If PHP session is created before login, there will be one session file created for each request to login page. The problem is if user makes multiple requests to server through a script then those many session files will be created. If user wants to attack server,he can send abnormally huge number of requests creating so many session fil...

Server Cookies?

I’ve inherited a rather convoluted project. The original designer created a “cookie” that appears to be server side rather than client based (though I could be very wrong on that part). He is using it for what he called “Least Privileges, Single Sign On”. I have the following code in all of the Web Service Proxies he set up: [WebServ...

Session timeouts in PHP: best practices

What is the actual difference between session.gc_maxlifetime and session_cache_expire() ? Suppose I want the users session to be invalid after 15 minutes of non-activity (and not 15 after it was first opened). Which one of these will help me there? I also know I can do session_set_cookie_params() which can set the user's cookie to exp...

google analytics - multiple trackers on one page (cookie conflict)

I'm writing a web application that's supposed to be embedded in other people's websites (kind of a widget). I'm using Google Analytics to track all the people that visit all instances of my script on the embedding websites. The problem is that I don't know how to use it so that it doesn't interfere with those websites' own Google Analyti...

What to do when there are two cookies with the same name in IE7?

Some background: CakePHP writes it's own session id cookie besides the PHPSESSID. This is used to authenticate a request. Then an SWFupload sends a file, and that token to authenticate, and is picked up as a new user agent - so in cakephp you must disable the "check-user-agent" security feature. On many browsers this is enough. IE7 ve...

To redirect an user back to index.php after a handler

I put "username" and "password" to a form of mine. The action starts up a handler.php. The user sees then only a white page (handler.page) if he does not reload his browser at handler.php. If he does, the handler puts him to back to index.php. I would like to put the user automatically back to the homepage after being at handler.php wh...

Command to clear the cookie-based session store in Rails.

I often want to clear the session store in Rails, in particular, the default cookie-based session store. Some sites seem to suggest that rake tmp:sessions:clear accomplishes this task, but it appears that it does not. What is the proper way to clear the cookie-based session store? ...

The unkillable cookie (classic ASP3, PHP5, IIS5, FF3.5, IE8)

I have a system which generates a cookie in PHP, then needs to delete it from classic ASP. This is a quick-and-dirty dev box, just a spare XP machine running IIS5, PHP5, and ASP3. I used the hosts file to create a fake domain name (www.localtest.com) since other parts of the process wouldn't work with localhost. The PHP file is in a sub...

Which .NET class parses a multiple HTTP cookies string into a CookieCollection or CookieContainer?

I am sure it already exists somewhere, just can't find it. ...

How to keep track of login status by PHP?

How can you keep track of login status by PHP? I include the following page to each my page to check the login status. I try to identify the user after he logs in by the cookie. However, I have not managed to read my login_cookie or use it in any way. The code *handle_login_status.php* where I manipulate the login status <?php $...