Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Delete Cookies when Login button is clicked.  (Read 4510 times)

0 Members and 1 Guest are viewing this topic.

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Delete Cookies when Login button is clicked.
« on: April 18, 2012, 12:22:36 am »

Hi, I am using Facebook Login plugin. The plugin is great, however, the users always have to clear their cookies if they would like to login again in a normal way. So, I am really in need to make the javascript delete cookies function run when clicking the "Normal Login" button so the users will not have to delete manually. Could you please give any suggestion?
Logged

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Delete Cookies when Login button is clicked.
« Reply #1 on: April 18, 2012, 09:38:14 pm »

I added the below codes to "login.php".

Quote
if (isset($_SERVER['HTTP_COOKIE'])) {
    $cookies = explode(';', $_SERVER['HTTP_COOKIE']);
    foreach($cookies as $cookie) {
        $parts = explode('=', $cookie);
        $name = trim($parts[0]);
        setcookie($name, '', time()-1000);
        setcookie($name, '', time()-1000, '/');
    }
}
and
Quote
setcookie ("cpg15x_cookies", "", time()-60000);

These codes still do not delete the cookies or reset them. Please, give me some suggestion. Users could not login the normal way without clearing the cookies.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Delete Cookies when Login button is clicked.
« Reply #2 on: April 19, 2012, 09:20:10 am »

I assume your first code block will never be executed, as $_SERVER['HTTP_COOKIE'] isn't set in cpg1.5.x by default. Please read http://documentation.coppermine-gallery.net/en/dev_superglobals.htm

I suggest to post your issue in the plugin's announcement thread (if there isn't already a solution).
Logged
Pages: [1]   Go Up
 

Page created in 0.025 seconds with 19 queries.