Logging in with existing cookies

82 views
Skip to first unread message

Ex Mortis

unread,
Nov 3, 2014, 2:12:00 AM11/3/14
to ajax...@googlegroups.com
yes, I checked here first: https://github.com/Frug/AJAX-Chat/wiki/Reuse-existing-session-cookie

So here's what's going on, I already have my own authentication, and I need the chat to use the existing authentication. Here's where I'm having issues: I've tried using cookies, and sessions, but I can never get the chat to recognize the variables I'm propagating... regardless of my config setting (you know, for existing sessions)

Anyways, I've modified the CustomAJAXChat.php file as well, to forcefully use my existing session, but, when I login with a guest account, that information is retained after I login using an account from my auth because getValidUserData() never gets hit again, since the user hasn't logged out yet through the chat auth. I have no idea what mechanism (besides in the DB) that keeps track of whom is still logged in, but I presume that is the session being initiated by chat.

The wonky thing is, when I try to dump this session... I get nothing... so at this point I'm at a loss.

I think the best way to do this would be to allow the chat to access a session with the variables already assigned, but for the life of me I can't seem to see the session created by chat, no can I seem to get the chat to see the sessions created by my auth... I'm at a loss.

Any help would be greatly appreciated.

Kevin Ingwersen (Ingwie Phoenix)

unread,
Nov 3, 2014, 2:24:14 AM11/3/14
to Ex Mortis, ajax...@googlegroups.com
As a rule of thumb: The chat expects to be the most-front application. Therefore, head to AJAXChat.php and find all instances of session_destroy() and other session_*() functions. Within AJAXChat::init() - I think… - the session is initialized. Comment that section out or remove it - but the chat may not modify the session by its own.

Cookies should be okay - however, due to the session being recreated, maybe these are also „forgotten“…

You need to also modify CustomAJAXChat::getAllUsers() to return a list of all your users available thru your system. CustomAJAXChat::getValidLoginUserData() may check against your system. Use custom.php (also located in lib/) to load your own system’s helper functions if needed.
--
You received this message because you are subscribed to the Google Groups "AJAX-chat" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ajax-chat+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages