Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Delete Cookies when Login button is clicked.  (Read 4086 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: 15765
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.015 seconds with 22 queries.