I have this code that setted when login check is fine:
if((isset($_POST["remember_me"]))&&($_POST["remember_me"]==1)) { setcookie('email', $username, time()+3600); setcookie('pass', $pass, time()+3600); }
Now, when I click on logout link (logout.php) i did this:
<?php session_start(); setcookie("email", '', 1, ""); setcookie("pass", '', 1, ""); $_SESSION["login"] = ""; header("location: aforum/enter_furom.php"); ?>
I didn’t use destroy session because I don’t want to destroy all sessions…. now destroying a session is working fine… but when I try to unset cookies, the browsers (all browsers: explorer, chrome, firefox, mozilla) give me an error saying that the new cookies cant be setted…any help to unset the above cookies ?
Related Posts:
- Cookies vs. sessions
- How do I expire a PHP session after 30 minutes?
- Check if a PHP cookie exists and if not set its value
- What is a slug?
- PHP “or” Syntax
- What are namespaces?
- Get the full URL in PHP
- Invalid column count in CSV input on line 1 Error
- How to check if a string starts with a specified string?
- mysqli_real_connect(): (HY000/2002): No such file or directory
- $wpdb->update or $wpdb->insert results in slashes being added in front of quotes
- Are there dictionaries in php?
- PHP how to make URL something like product.php?id=1
- laravel updateOrCreate method
- How to listen messageSent event in laravel 5.5
- Mixing a PHP variable with a string literal
- Make a HTTPS request through PHP and get response
- How do the PHP equality (== double equals) and identity (=== triple equals) comparison operators differ?
- How to verify password against database?
- what is a good method to sanitize the whole $_POST array in php?
- pdo – Call to a member function prepare() on a non-object
- Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 71 bytes)
- Compare given date with today
- Difference between $_SERVER[‘DOCUMENT_ROOT’] and $_SERVER[‘HTTP_HOST’]
- Multi-line strings in PHP
- Commands out of sync; you can’t run this command now
- Refresh a page using PHP
- cURL error 60: SSL certificate: unable to get local issuer certificate
- Laravel 5.2 Storage::makeDirectory($dir) is not creating directory
- Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0
- Replace spaces with a dash in a URL
- Are PDO prepared statements sufficient to prevent SQL injection?
- Message: Trying to access array offset on value of type null [duplicate]
- retrieve data from db and display it in table in php .. see this code whats wrong with it?
- Count how many files in directory PHP
- Simple PHP calculator
- Convert from MySQL datetime to another format with PHP
- Child theme css not overriding parent
- php foreach with multidimensional array
- Convert timestamp to readable date/time PHP
- Creating a php search bar
- header location not working in my php code
- PHP Error: Function name must be a string
- Uncaught Error: Call to undefined function mysql_escape_string()
- What does ‘=' mean in PHP?
- Warning: mysqli_query() expects at least 2 parameters, 1 given. What? [duplicate]
- PHP cURL custom headers
- Laravel 5 MethodNotAllowedHttpException in RouteCollection.php line 201:
- How to convert string to boolean php
- PHP “&” operator
- Are There Any Cron Jobs Alternative?
- How to Create Multiple Where Clause Query Using Laravel Eloquent?
- PHP: How to get referrer URL?
- What is ?
- Connection reset by peer: mod_fcgid: error reading data from FastCGI server
- Warning: A non-numeric value encountered
- How to import csv file in PHP?
- What is the syntax for accessing PHP object properties?
- Proper Format of iframe in PHP?
- How to find the last day of the month from date?
- php_network_getaddresses: getaddrinfo failed: Name or service not known (0) Failed To Connect..!
- Composer: Command Not Found
- * failed to open vchiq instance
- Undefined variable: $_SESSION
- Error:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
- Mysql where id is in array
- How to extract and access data from JSON with PHP?
- Warning “Do not Access Superglobal $_POST Array Directly” on Netbeans 7.4 for PHP
- How to write a link like which link to the same page in PHP?
- Call a REST API in PHP
- Fatal error: Call to a member function query() on null
- How can I write php code in notepad++?
- Insert string at specified position
- How to run a PHP function from an HTML form?
- How to insert TIMESTAMP into my MySQL table?
- Remove warning messages in PHP
- PHP date yesterday [duplicate]
- Clear cache in Symfony: `cache:clear` or `rm -rf`?
- Convert timestamp to readable date/time PHP
- create php live clock
- In where shall I use isset() and !empty()
- Converting a UNIX Timestamp to Formatted Date String
- PHP Call to undefined function
- Formatting a number with leading zeros in PHP
- POST an array from an HTML form without javascript
- php, cookies, wordpress – how to make automatic login in one one site, login and on other one
- Setting custom cookies in WordPress
- Why is PHP Cookie via plugin only set when logged in as Admin and not regular users? and other questions
- Why is my cookie not unsetting upon logout? [closed]
- How to store post ID’s in cookie or session to display the same posts later
- My php code is not being executed
- $_SESSION variable not saving on page refresh or new page
- How to set cookies
- Cookie value changes back to previous value after changing
- IF statement not working – Any suggestions?
- WordPress load javascript file if something… (after the page is loaded)
- Serve cookie free URLs in WordPress without using a CDN
- Keep users logged in Without Remember Me
- Why can’t I enter the wordpress admin interface?