• 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

How to destoy session

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

Post a reply
13 posts • Page 1 of 1

Postby prashcom » Mon Apr 23, 2007 3:14 pm

I am using phpfreechat 1.0-beta10 ,trying to integrate this system with phpbb forums. I used this http://www.phpfreechat.net/faq.en.html#phpbb thread to configure the setting and its working fine (showing the nickname)...

but suppose if once i login with abc and again if i will try to login with xyz then its showing me the previous conversation of abc too. This means its treating new user as abc not as different user xyz, because its setting session and if once its getting the session its treating the user as previous one.

Is it possible to destroy the session completely before any new login? And how to use phpbb session instead of phpfreechat session?

Is i need to do something in pfcuserconfig.php:

$c =& pfcGlobalConfig::Instance();

// start the session : session is used for locking purpose and cache purpose

session_name("phpfreechat"); //$c->nick

if(session_id() == "") session_start();

$this->nickid = session_id();

or i need to change in pfcglobalconfig?

Please help me out!!!
It doesn’t matter how rocky the road may be, The road will clear if you keep walking......
prashcom
New member
 
Posts: 4
Joined: Mon Apr 23, 2007 2:52 pm
Location: Calcutta India
  • Website
Top

Postby phpfreechat » Wed Apr 25, 2007 10:16 am

try to add this parameter :
$params['frozen_nick'] = true;
it will force the nickname to be changed if $params['nick'] is dynamicaly changed.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby prashcom » Wed Apr 25, 2007 10:56 am

I did it but no luck!!!

Suppose when abc was logged in and chatted with someone including few private chat and then if xyz logged in then the private chat box of abc is stillshowing??

Logically that should not be shown!

This is my code

$params = array();
$params["serverid"] = md5("Community Chat Room");
$params["title"] = "Community Chat Room";
//$params["nick"] = isset($UserDetailsInArray['username'])?$UserDetailsInArray['username']:'';
$params["nick"] = iconv("windows-1251", "UTF-8", $userdata[username]);
$params["channels"] = array("Community Chat Room");

$chat = new phpFreeChat( $params );

and also in globalconfig file

var $frozen_nick = true;

Once i am changing my nickname i am getting msg "You are not allowed to change your nickname" but once i am clicking on msg box then that msg disappear!!

I think this time i will get better solution
Last edited by prashcom on Wed Apr 25, 2007 11:00 am, edited 1 time in total.
It doesn’t matter how rocky the road may be, The road will clear if you keep walking......
prashcom
New member
 
Posts: 4
Joined: Mon Apr 23, 2007 2:52 pm
Location: Calcutta India
  • Website
Top

Postby morcth » Wed Apr 25, 2007 8:15 pm

frozen_nick works with this if the browser window is closed but if you just log out of the chat and then login with a new user name without restarting the browser then it will log you in as the old user and not the new one. I need this as well. I need to destroy the session or clear cache whatever before each new login. Is this possible? In my opinion this is a security risk because if more than one user uses the same computer for my site and someone forgets to close the browser when they leave my site, then the second person can chat under the first users name.
morcth
New member
 
Posts: 6
Joined: Tue Mar 13, 2007 4:59 pm
Top

Postby prashcom » Thu Apr 26, 2007 5:33 am

I think the problem is with Session. If once we can specify session timeout then i think the problem may solve?? i deadly need help to destroy my session everytime when user will logged in. I think this is the biggest drawback of phpchat system...

I worked almost full day with the code but not finding the solution... :(
Last edited by prashcom on Thu Apr 26, 2007 5:35 am, edited 1 time in total.
It doesn’t matter how rocky the road may be, The road will clear if you keep walking......
prashcom
New member
 
Posts: 4
Joined: Mon Apr 23, 2007 2:52 pm
Location: Calcutta India
  • Website
Top

Postby phpfreechat » Thu Apr 26, 2007 3:48 pm

Maybe put this simple code in your forum login page :
Code: Select all
$oldsessionname = session_name();
session_name( 'phpfreechat' );
if(session_id() != '') session_destroy();
session_name( $oldsessionname  );
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby morcth » Thu Apr 26, 2007 10:36 pm

I am using phpfreechat integrated with a joomla site that is installed on my local system. I pasted that code into where the login is processed into joomla. I did not get an error or anything but it did not change the outcome. I need the login to PFC to not check any past usernames in cache or sessions each time someone logs in. Any more ideas? Thanks.

Josh
morcth
New member
 
Posts: 6
Joined: Tue Mar 13, 2007 4:59 pm
Top

Postby phpfreechat » Fri Apr 27, 2007 10:59 am

Sorry my above code is wrong, try this one :
Code: Select all
$oldsessionname = session_name();
session_name( 'phpfreechat' );
session_start();
session_destroy();
session_name( $oldsessionname  );
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby morcth » Fri Apr 27, 2007 9:35 pm

This should go in my Joomla login function or in my pfc login function or mychat.php?
morcth
New member
 
Posts: 6
Joined: Tue Mar 13, 2007 4:59 pm
Top

Postby prashcom » Sat Apr 28, 2007 5:41 am

Thanks kerphi i think this code will help me in pfc login.

And Morcth this code is for pfc login.

Morcth will you pls explain in details, so that i will help you out!!
It doesn’t matter how rocky the road may be, The road will clear if you keep walking......
prashcom
New member
 
Posts: 4
Joined: Mon Apr 23, 2007 2:52 pm
Location: Calcutta India
  • Website
Top

Postby morcth » Sat Apr 28, 2007 3:11 pm

Sure because I dont think this worked for me. I have a joomla site and I integrated PFC into it and it works nicely. If I log into Joomla as administrator and then click the chat link on the menu, a new window opens and PFC logs me in as administrator. Then I will close the chat window, log out of joomla and log back in as demo. If i click the chat link, PFC opens up and I am still administrator. If i close the chat and the joomla window and then start it back up and log in again then everything is fine but I need it to work without closing the joomla window... it could be a security issue. So I need PFC to not look at the session or cache for info on any login. Thanks for any help.

Josh
morcth
New member
 
Posts: 6
Joined: Tue Mar 13, 2007 4:59 pm
Top

Postby King Moonraiser » Wed Jun 27, 2007 5:23 am

kerphi wrote:Sorry my above code is wrong, try this one :
Code: Select all
$oldsessionname = session_name();
session_name( 'phpfreechat' );
session_start();
session_destroy();
session_name( $oldsessionname  );


At what point does this code get added? Before or after the "$chat = new phpFreeChat( $params );"?
King Moonraiser
Member
 
Posts: 98
Joined: Fri Jun 22, 2007 9:42 pm
  • Website
Top

Postby phpfreechat » Sat Jun 30, 2007 7:29 pm

This code is used to clear the phpfreechat session (logout).
So you can use this code in your external authentification system in order to disconnect phpfreechat when you disconnect from your authentification system.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top


Post a reply
13 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 10 guests

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