Hi
i m using cookies to store data in an form containing textfields
and using the following codes., -
<?
-
$act=$_REQUEST['act'];
-
-
if($act==1)
-
{
-
$one=$_POST['1'];
-
$two=$_POST['2'];
-
$three=$_POST['3'];
-
-
setcookie ('field[1]', $one);
-
setcookie ('field[2]', $two);
-
setcookie ('field[3]', $three);
-
?>
-
<meta http-equiv="refresh" content="0;url=cook.php">
-
<?
-
-
}
-
if($act=="del")
-
{
-
$f=$_REQUEST['f'];
-
-
if($f==1)
-
setcookie ("field[1]", FALSE);
-
else if($f==2)
-
setcookie ("field[2]", FALSE);
-
else if($f==3)
-
setcookie ("field[3]", FALSE);
-
-
?>
-
<meta http-equiv="refresh" content="0;url=cook.php">
-
<?
-
-
}
-
$onec=$_COOKIE['field']['1'];
-
$twoc=$_COOKIE['field']['2'];
-
$threec=$_COOKIE['field']['3'];
-
?>
-
-
<form name="form1" method="post" action="cook.php?act=1">
-
<table width="100%" border="0" cellspacing="0" cellpadding="0">
-
<tr>
-
<td width="12%" height="22" align="center" valign="middle"><span class="style1">1</span></td>
-
<td width="75%" align="center"><label>
-
<input name="1" type="text" id="1" style="border:#FFFFFF; color:#CC3366;background:#FAECDF; border:none; " size="30" value="<? if($act==1) echo $one; else echo $_COOKIE['field']['1'];?>" />
-
</label></td>
-
<td width="13%"><a href="cook.php?act=del&f=1"><img src="images/delete-btn.png" alt="exitbtn" width="15" height="15" border="0"/></a></td>
-
</tr>
-
<tr>
-
<td height="25"align="center" valign="middle"><span class="style3">2</span></td>
-
<td align="center" valign="middle"><input name="2" type="text" id="2" style="border:#FFFFFF; color:#CC3366;background:#FAECDF; border:none; " size="30" value="<? if($act==1) echo $two; else echo $_COOKIE['field']['2'];?>" /></td>
-
<td><a href="cook.php?act=del&f=2"><img src="images/delete-btn.png" alt="exitbtn" width="15" height="15" border="0"/></a></td>
-
</tr>
-
<tr>
-
<td height="23" align="center" valign="middle"><span class="style1">3</span></td>
-
<td align="center"><input name="3" type="text" id="3" style="border:#FFFFFF; color:#CC3366;background:#FAECDF; border:none; " size="30" value="<? if($act==1) echo $three; else echo $_COOKIE['field']['3'];?>" /></td>
-
<td><a href="cook.php?act=del&f=3"><img src="images/delete-btn.png" alt="exitbtn" width="15" height="15" border="0"/></a></td>
-
</tr>
-
</table>
-
</form>
-
-
when i implemented the above code.,
i got all the results perfectly.,
but in IE when i clear the cookies using the browser options i didnt get the cookies cleared and values are displayed in the corresponding fields.,
How can this possible., the cookies should get cleared right?
regards
vijay
Jul 5 '08
14 5225
As pbmods already suggested, IE is showing you a cached version of the page. I'm going to say it again: you're not using PHP to delete the cookies, but the browser. Therefore, this isn't a PHP problem.
then what is the solution for this??
is there no way?
TheServant 1,168
Recognized Expert Top Contributor
then what is the solution for this??
is there no way?
So have you tried refreshing the page manually? If you can't, remove the meta refresh in your code and try again.
Have you set your cookie expiration anywhere, like your php.ini file (if that is where it is defined)? Have you tried it on a different computer/different browser?
If you have a cookie which won't allow itself to be removed then you have pretty amazing cookie. Otherwise you will need to try a browser troubleshooting page.
Are the cookies going into the usual cookie place? As in where your cookies usually go?
So have you tried refreshing the page manually? If you can't, remove the meta refresh in your code and try again.
Have you set your cookie expiration anywhere, like your php.ini file (if that is where it is defined)? Have you tried it on a different computer/different browser?
If you have a cookie which won't allow itself to be removed then you have pretty amazing cookie. Otherwise you will need to try a browser troubleshooting page.
Are the cookies going into the usual cookie place? As in where your cookies usually go?
Tried refreshing the page by both ways.,
No i didnt hav set my cookie to expire anywhere.,
and already tried with different computers and browsers.
and my cookie is going to the usual cookie place only.,
i m damn sure abt this.,
TheServant 1,168
Recognized Expert Top Contributor
What is your cookie named? And just checking, the cookies from your site are the only ones not deleting? There are no other persistant cookies?
hi
my cookies alone are not deleted.,
i tried by using the link
http://www.labpixies.c om/campaigns/todo/todo.html
and this too shows the cached page when i tried by deleting the cookies through browser settings(IE).,
but if i press delete all instead of pressing delete cookies in browser options., i get the new page with all cookies deleted.
and one more question
is there a limit to set number of cookies??
i need to set upto 30 cookie variables.,
is it possible.,
firefox allows me to set more than 30 cookie variables.,
but IE allows only 20 cookie variables to be set., if i m setting next cookie variable then the first cookie variable i had set gets expired..,
but i'm in need to set about 20 to 30 cookie variables.,
is there any way??
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Phil Powell |
last post by:
I am having this problem: My PHP script will set a cookie, it's there in my
/Cookies folder. I delete the cookie (I have to for testing purposes, the
PHP script I run behaves according to this cookie existing or not) and run
the script again. Everything runs fine, but the cookie is never set again.
Does anyone know why this happens? I am using Win2000 Professional with IE
6. Cookies are being set with PHP and Javascript.
Thanx
Phil
|
by: John |
last post by:
I am storing user names and addresses in cookies so that they do not
have to enter them in forms. But now if I try to send the form with
new data, the data in cookies is always called when I press the submit
button. The data that I have entered get deleted and the data in the
cookies is submitted. This also happens in scripts where I am not even
using cookies to set the forms. How do I solve this problem?
Thank you
John
|
by: Amit D.Shinde |
last post by:
Hello Experts..
I need some help regarding cookies and session objects and also
global.asa file
I am creating one cookie when a user logs in on my website.
The cookie stores the login name of the user. I want that cookie
should get deleted when user closes the browser without signing out.
I think it is done in global.asa file . But i don;t know how to do it?
|
by: |
last post by:
Is it possible for a user to enable permanent cookies but disable session
cookies.....this seems like a contradition yet this is what I appear to be
reading in online articles?
|
by: anony |
last post by:
Hi,
I have a site that uses forms authentication to secure the directory. The
site behaves as expected when viewed externally... if I close the browser
and attempt to access it again, I get prompted to login. However, locally
here on the network, if I close the browser and open a new one and access
the site again, I don't have to login. Can anyone shed some light as to
what's going on?
Thanks,
| |
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 post back, when
I try to retreive it from Request.Cookies collection, it appears that it does
not exists.
This problem does not occur on several developing machines we use for
developing application, but occurs in another environment (another...
|
by: Marcus |
last post by:
I know that when you start a session in PHP, the "cookie" it creates is
not the same as those that are stored in your browser's temp folder, and
instead is kept in RAM. I am confused because in every session tutorial
I have ever read, the author invariably mentions the 2 main ways of
propagating sessions - through cookies and appended to the URL. The
author also almost always talks about the method being dependent on the
user's...
|
by: the friendly display name |
last post by:
Easy to describe that problem: The cookies will be deleted after the user
closes the browser, but I have set persistance to true. Code:
------
TicketForPremium = new FormsAuthenticationTicket(1, UserID, DateTime.Now,
DateTime.Now.AddHours(10), true, "1");
TicketForPremiumCrypted = FormsAuthentication.Encrypt(TicketForPremium);
Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName,
|
by: cmrchs |
last post by:
Hi,
In Windows Vista: where does asp.net write its cookies?
I use
HttpCookie objCookie = new HttpCookie("nameCookie");
in Win2000 (and later) they used to be in
C:\Documents and Settings\Administrator\Cookies
but not anymore
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |