473,385 Members | 1,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Physical location of cookies created by setCookie() function, and expiry

49
I am not able to locate the cookies created by the setCookie function. They are not in the standard IE folder where temporary Internet files and cookies are placed. Does anyone know where I search, or how I trace them?

Also, I created cookies using this command:

Expand|Select|Wrap|Line Numbers
  1. $string_to_check = $type."_".$pid;
  2. setCookie("$string_to_check", "1", time()+30*1);
  3.  
The cookie doesn't expire in 30 seconds - in fact, it doesn't seem to expire at all.

One of the reasons that I want to see the actual cookies is to see what the expiration time is being set to.

I'd be quite grateful for any pointers. Thank you very much for your time!
Aug 25 '07 #1
6 2646
pbmods
5,821 Expert 4TB
Heya, knkk.

You could run some JavaScript on the client side:
Expand|Select|Wrap|Line Numbers
  1. document.write(document.cookie);
  2.  
I think when setting cookie expiration dates, you have to format your datetime in RFC standard format. Try using:
Expand|Select|Wrap|Line Numbers
  1. setcookie( ..., date(DATE_RFC822, time() + 30));
  2.  
Aug 26 '07 #2
knkk
49
Heya, knkk.

You could run some JavaScript on the client side:
Expand|Select|Wrap|Line Numbers
  1. document.write(document.cookie);
  2.  
I think when setting cookie expiration dates, you have to format your datetime in RFC standard format. Try using:
Expand|Select|Wrap|Line Numbers
  1. setcookie( ..., date(DATE_RFC822, time() + 30));
  2.  
Thanks, pbmods. I am trying to do this using php itself, not JS. Also, I just noticed that my code works in FF but not in IE. That is, the cookie expires in FF in 30s, but not in IE. But I do not see the actual cookie in FF either (when I do Tools -> Options -> Show Cookies).

I tried your RFC command, but it doesn't appear to set the cookie at all.
Aug 26 '07 #3
knkk
49
Well, I am able to see the actual cookie in FF and in IE now (though I did nothing different ). I guess it was always visible in FF - it was just expiring in 30s, before I could see it. In IE, however, it is showing up suddenly now, and this is the text of the cookie file:

events_3525
1
www.mydomain.com/
1536
3949138304
29878276
3661621984
29878196
*

Would anyone know what all those numbers mean? Thank you for your time.
Aug 26 '07 #4
knkk
49
I just figured that my IE cookie expires in about 9 hours and 33 minutes though I set it to expire in 30 seconds. Cannot figure out why :(.
Aug 26 '07 #5
knkk
49
Okay, so I figured this out. The time zones in the client machine and the server were different. I set them both to the exact same time and zone, and IE too started working.

For anyone who needs to do the same on a Linux box (change the time zone):

http://www.linuxsa.org.au/tips/time.html
Aug 26 '07 #6
pbmods
5,821 Expert 4TB
Heya, Knkk.

Thanks for posting your solution!

Glad to hear you got it working! Good luck with your project, and if you ever need anything, post back anytime :)
Aug 26 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: xo55ox | last post by:
I am very new with php. And I want to find out how do I capture user cookies information for traffic analysis on Windows machine and server cookies from Linux server. thanks.
1
by: StinkFinger | last post by:
Hello all, I am using two separate setcookies to create and maintain cookies for every day users and one for admins. When a casual user hits a page I use this:...
2
by: Lisa | last post by:
Can anyone tell me why the cookie created by this javascript... <script language=javascript type="text/javascript"> <!-- function SetCookie(username, value, expires, path, domain) {...
2
by: Thomas Krebs | last post by:
Is it possible to set a cookie in a HTML file which is loaded from the local filesystem (protocol is 'file:' instead of 'http')? It seems that I can set the cookie and I am also able to access it...
3
by: Mandy Holmes | last post by:
Hi all (Newbie alert!) I am a bit stuck. I want to set a cookie when a hyperlink on my website is clicked. This cookie will then be used to determing which of 5 images is displayed on that page...
6
by: Nicolae Fieraru | last post by:
Hi All, I recently discovered that my session cookies on the web host disappear within 30 seconds. I created some very simple asp scripts (it took me a while until I discovered why my shopping...
7
by: Bert | last post by:
I have been reading the post and the FAQ and have been unable to find anything that will help with my problem. First let me say that I am not a web developer, designer and no next to nothing...
5
by: Miljana | last post by:
Hi, I have one problem with cookies in ASP.NET application. It seems that I can not retreive cookie from Request.Cookies collection. I put cookie in Response.Cookies collection, and after page...
4
by: ddolgoff | last post by:
Hello to everyone, I have a problem of managing a session with cookies and "session_set_save_handler()". I want to use php's built-in session management mechanism with user-level session storage...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.