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: -
$string_to_check = $type."_".$pid;
-
setCookie("$string_to_check", "1", time()+30*1);
-
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!
6 2646
Heya, knkk.
You could run some JavaScript on the client side: -
document.write(document.cookie);
-
I think when setting cookie expiration dates, you have to format your datetime in RFC standard format. Try using: -
setcookie( ..., date(DATE_RFC822, time() + 30));
-
Heya, knkk.
You could run some JavaScript on the client side: -
document.write(document.cookie);
-
I think when setting cookie expiration dates, you have to format your datetime in RFC standard format. Try using: -
setcookie( ..., date(DATE_RFC822, time() + 30));
-
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.
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.
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 :(.
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
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 :)
Sign in to post your reply or Sign up for a free account.
Similar topics
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.
|
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:...
|
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)
{...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
| | |