• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

session problem changing nick

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
8 posts • Page 1 of 1

Postby rakitir » Tue May 31, 2011 3:23 pm

I've got an existing user authentication system that I'm trying to integrate. I'm testing the following config:

if (isset($_SESSION['valid'])){
$params["nick"] = $_SESSION['user'];
}

Which works fine if the session exists at the time pfc loads. However if the session doesn't exist pfc asks for a username. If provide a username (say X) and some time after log into the CMS pfc, keeps the previous nick (X) even thought the page reloaded and $_SESSION['valid'] was set.

I guess I need to flush pfc sessions when loging in with the CMS. Any suggestions?

Thanks
rakitir
New member
 
Posts: 8
Joined: Tue May 31, 2011 3:12 pm
Top

Postby re*s.t.a.r.s.*2 » Tue May 31, 2011 4:54 pm

hi,

you need to destroy phpfreechat session before going to the login page for you CMS system.. then when logged redirect back to pfc-chat...

and use $params['frozen-nick']= TRUE;

hope that helps.
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby rakitir » Tue May 31, 2011 5:11 pm

sorry, I don't understand english..
my cod

require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();

$nick = '';
if (isset($_SESSION['login'])){
$nick = $_SESSION['login'];
$params['dyn_params'] = array('frozen_nick');
$params["frozen_nick"] = true;
}
else
{
$nick = "Guest".rand(1,100);
}

$params["nick"] = $nick;
$params["serverid"] = md5(__FILE__);
$chat = new phpFreeChat( $params );
rakitir
New member
 
Posts: 8
Joined: Tue May 31, 2011 3:12 pm
Top

Postby rakitir » Tue May 31, 2011 5:21 pm

with this cod works, but the first time that it is impossible to send messages.

before logging
Image

after logging
Image

after the update page
Image
rakitir
New member
 
Posts: 8
Joined: Tue May 31, 2011 3:12 pm
Top

Postby rakitir » Tue May 31, 2011 5:23 pm

re*s.t.a.r.s.*2
parlo un po italiano, aiuta mi per favore!
rakitir
New member
 
Posts: 8
Joined: Tue May 31, 2011 3:12 pm
Top

Postby re*s.t.a.r.s.*2 » Tue May 31, 2011 7:58 pm

Code: Select all
<?php
session_start();

$nick = '';
if (isset($_SESSION['login'])){
  $nick = $_SESSION['login'];
 // $params['dyn_params'] = array('frozen_nick');
  $params["frozen_nick"] = true;
  }
else
{
  $nick = "Guest".rand(1,100);
}

$params["nick"] = $nick;
$params["serverid"] = md5(__FILE__);
$chat = new phpFreeChat( $params );

?>

Start the session on top, because I dont see any require where you could have initiated the session..

"/rehash"

regards.

regards..
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby rakitir » Tue May 31, 2011 9:04 pm

not works.
/rehash? how to use it?
rakitir
New member
 
Posts: 8
Joined: Tue May 31, 2011 3:12 pm
Top

Postby re*s.t.a.r.s.*2 » Wed Jun 01, 2011 2:28 am

hi,
Code: Select all
<?php
session_start();

$nick = '';
if (isset($_SESSION['login'])){
  $nick = $_SESSION['login'];
  }
else
{
  $nick = "Guest".rand(1,100);
}
$params["frozen_nick"] = true;
$params["serverid"] = md5(__FILE__);
$chat = new phpFreeChat( $params );

?>

just type /rehash as admin in the chat...
try the new code again..

regards.
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top


Post a reply
8 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 26 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
cron
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub