• 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

Trouble with sessions / external server

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

Post a reply
7 posts • Page 1 of 1

Postby buddyman83 » Mon Aug 29, 2011 8:37 am

Hi,

i would like to use the PFC but i have to install it on an external server since i'm not allowed to install chats at all on my normal server.

So on Server 1 i have sth like this

<iframe src="123.123.123.123/chat/index.php?username=bunny"></iframe>

and in the index.php from the other server

....
$params[nick] = $_GET["username"];
....

It seems to work, but everytime i open the chat with different usernames, the chat doesn't recognize this :(

How can i manage that every time i open the chat it takes the username written in die param-array, not in any sessions?

thanks for all help & sorry for bad english

regards
buddyman83
New member
 
Posts: 2
Joined: Mon Aug 29, 2011 8:26 am
Top

Postby re*s.t.a.r.s.*2 » Mon Aug 29, 2011 5:58 pm

Hi,

You have to use SESSION before and then redirect to the chat index.php, then if your chat is picking up the old nick , you will need to destroy the session for the chat to pick the new nick..

this is the default behavior of PFC or you could also place a logout link at index.php, when user want to leave make him click the link and when he return pickup again a nick and so the chat can use it..


hope this help 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 buddyman83 » Tue Aug 30, 2011 8:46 am

hi,

thanks for reply. Can you tell me at which point i have to destroy the session?
buddyman83
New member
 
Posts: 2
Joined: Mon Aug 29, 2011 8:26 am
Top

Postby re*s.t.a.r.s.*2 » Tue Aug 30, 2011 7:53 pm

Hi,

At the point he or she wants to change nickname...
they will return to your form to get a new nick, so you need to destroy Session before so they can get the new nick or else the chat will use the one already in the session.

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 ozled » Sat Dec 10, 2011 6:26 pm

Hi there,

I have a similar setup and the same problem.
In the community server I call the chat inside an iframe using the URL:

<host>/login.php?nick=name
The login.php script does open a PHP session, saves the passed arguments, and other parameters, in the session and then calls chat.php that is then opening the chat.

When a user logs out I call the URL:

<host>/logout.php

to logout from the chat as well, but I can only manage to destroy the session initially created by login.php.
When a new user logs in (without closing the browser) and the iframe is re-opened, the chat remembers the previous nick even though login.php is called with the new one.

How can I make the chat forget about the previous nick without forcing my users to close the browser ?
Is there something like:
$chat = new phpFreeChat( $params );
$chat->logout();

Thanks for any help
ozled
New member
 
Posts: 7
Joined: Sat Dec 10, 2011 6:14 pm
Top

Postby re*s.t.a.r.s.*2 » Sat Dec 10, 2011 9:08 pm

Hi,

Are you destroying all the session, because if you are doing so you shouldnt have the nick session that chat uses to pass the nick internally..

You need to destroy the session complete not only the session you used to pass the nick to your Iframe but the global session then redirect to you login page ..

If your are in the same URL you should be able to regenerate another session when login out..

I hope I make sense because I have never played with Iframes..

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 ozled » Sat Dec 17, 2011 5:43 pm

Thanks for your reply.

After reading it I was prompted to review the whole logout process and it turned out that I was destroying the wrong session.
I solved the issue by redirecting the browser first to the chat logout.php and from there back to the site home page.
Wrt the iframe, it seems to behave as if one opened a separate/independent browser tab directly to the chat.

Regards
ozled
New member
 
Posts: 7
Joined: Sat Dec 10, 2011 6:14 pm
Top


Post a reply
7 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 6 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