Jump to content

Clear Cookie


Arun Kumar

Recommended Posts

I think some of my users are experiencing issues with cookies after IPB 4.x upgrade as some of them reported that their login is not getting saved and keeps getting logged out. Is there a way to reset the cookie using the forum link. I remember that a link was there in an older version of IPB which is used to reset or clear the user's cookie. Is there something similar now or is the only way to clear all cookies through the browser settings?

Link to comment
Share on other sites

Likely what is happening is the cookie is either corrupt or still from your previous version which you won't be able to do anything about via the system. Each user will need to delete their cookies in their browser, unfortunately. 

 

Link to comment
Share on other sites

Actually you can try. Create new php file and insert this code:

<?php

// Initialize IPS4 Framework
require 'init.php';

// Create new /DateTime and set it to in the past (day ago, for example)
$datetime = \IPS\DateTime::create()->sub( new \DateInterval( 'P1D' ) );

// Get all cookies generated by IPS Framework and set expiry date to in the past
foreach( \IPS\Request::i()->cookie as $cookie => $data )
{
	\IPS\Request::i()->setCookie( $cookie, '', $datetime );
	\IPS\Request::i()->setCookie( $cookie, '', $datetime, NULL, TRUE, NULL, '/' );
}

// Then redirect member to homepage
\IPS\Output::i()->redirect( \IPS\Settings::i()->base_url );
Link to comment
Share on other sites

  • 10 months later...
On 2016-7-11 at 3:54 PM, Ilya Hoilik said:

Actually you can try. Create new php file and insert this code:


<?php

// Initialize IPS4 Framework
require 'init.php';

// Create new /DateTime and set it to in the past (day ago, for example)
$datetime = \IPS\DateTime::create()->sub( new \DateInterval( 'P1D' ) );

// Get all cookies generated by IPS Framework and set expiry date to in the past
foreach( \IPS\Request::i()->cookie as $cookie => $data )
{
	\IPS\Request::i()->setCookie( $cookie, '', $datetime );
	\IPS\Request::i()->setCookie( $cookie, '', $datetime, NULL, TRUE, NULL, '/' );
}

// Then redirect member to homepage
\IPS\Output::i()->redirect( \IPS\Settings::i()->base_url );
 

Does this actually work??

We recently converted from xenforo and several members are having cookie issues. It would be great if we could force users cookies to refresh or something so that we don't have to keep saying the same thing over and over. It seems our members like to ignore the phrase clear your browser cookies and cache and all will be fixed. 

 

If this does, in fact, work how is it used? Do you get users to visit the url to that php file?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...