| | |
Question about cookies
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2005
Posts: 150
Reputation:
Solved Threads: 13
Are you sure? Normally, when using session_destroy() the cookie isn't deleted - you have to do it manually. Maybe, you can post your code here, so that people get an ideo of your problem.
•
•
Join Date: Apr 2009
Posts: 64
Reputation:
Solved Threads: 1
Yes, I am sure. I logged in, checked, and the cookie was there. I logged out, checked, and the cookie had been deleted. Here is my cookie script:
Here is my logout script:
Could it be because I am using isset to set the cookie possibly?
Well it's not the isset. Here is the revised code:
It's as if PHP is treating it as a session cookie.
php Syntax (Toggle Plain Text)
<?php if(isset($_SESSION['theme'])); $theme = $_SESSION['theme']; setcookie(theme,$theme,time()+(60*60*24*365)); ?>
php Syntax (Toggle Plain Text)
<? session_start(); if($_SESSION["uname"]<> "") { session_unset(); session_destroy(); header( "Location:index.php" ); exit(); } ?>
Well it's not the isset. Here is the revised code:
php Syntax (Toggle Plain Text)
<?php if($_SESSION['theme']); $theme = $_SESSION['theme']; setcookie(theme,$theme,time()+(60*60*24*365)); ?>
Last edited by Tekkno; Aug 17th, 2009 at 2:33 pm.
![]() |
Similar Threads
- Cookie or Session for shopping card (PHP)
- Log out page (PHP)
- DHTML pop up help (JavaScript / DHTML / AJAX)
- Cookies and JSP website (JSP)
- Is session will work if cookies are disbaled on clinet side? (PHP)
- when to use session and cookies variables ? (ASP)
- Cookies folder within Temp folder (Windows NT / 2000 / XP)
- Registry question (Windows Software)
- Changing Network Configuration (*nix Software)
Other Threads in the PHP Forum
- Previous Thread: mail from SMTP authentication script doesn't seem to work
- Next Thread: convert anyfile to html
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date development directory display download dynamic echo email error file files filter folder form forms function functions gc_maxlifetime google host href htaccess html image include insert integration ip java javascript joomla limit link login loop mail memmory memory menu mlm mod_rewrite multiple mysql navigation oop parse parsing paypal pdf php problem query radio random recursion regex remote script search server sessions sms snippet soap source space sql structure syntax system table thesishelp tutorial update upload url validation validator variable video web xml youtube





