X7 Chat Support Board
Welcome, Guest. Please login or register.
July 31, 2010, 07:39:49 PM

Login with username, password and session length
Search:     Advanced search
X7 Chat Version 3.0.0 Alpha 2 is now available (http://x7chat.com/support_forum/index.php?topic=3198.msg11497#new).
13036 Posts in 3760 Topics by 66535 Members
Latest Member: svabodabelarus1999
* Home Help Search Login Register
+  X7 Chat Support Board
|-+  Version 1 Archive
| |-+  [Version 1] Mod Support
| | |-+  Session Variables and log in persistence
« previous next »
Pages: [1] Reply Send this topic Print
Author Topic: Session Variables and log in persistence  (Read 3033 times)
Dcoach
Member
*
Offline Offline

Posts: 8


View Profile Email
« on: January 06, 2005, 09:38:50 PM »
Reply with quote

I envision someone logging into my site, but not going to the chat room right away.  Then when they open the chat, I'd like them to be logged in already.  Also, if someone logs into the chat and then wants to go from the chat room to read another page on my site, without logging out, I'd like them be logged into my site.  I left the chat room and then came back, and was still logged in, so it seems like this could work.  

From what I've been reading, I think this has to do with session variables.  If I'm on the right track, could someone provide some info on the x7 session variables I'd need to know about for log in persistence, and how to use and pass them?  

A mod I thought might work would be to use the x7 log-in page as the only log-in page for my site, but send the user to one of my pages instead of the chat room.  Then if they want to chat, I'd send them from my page to the chat room, or they could go around my site and then to the chat room.  

Does this sound feasible?  
Report to moderator   Logged
E-Oreo
Administrator
Member
*****
Offline Offline

Posts: 3710


View Profile Email
« Reply #1 on: January 07, 2005, 06:06:11 AM »
Reply with quote

X7 Chat stores the user's username in a cookie and the user's password in a cookie.  As long as the path is set to "/" and your website is on the same domain name as your chat room then your site will be able to read the X7 Chat.  For the purposes of cookies subdomains count as unique domains, a cookie from chat.yoursite.com is not readable on yoursite.com.

The defaults are
X2CHATU for username
X2CHATP for password
(note that it is X2 not X7)

You could either set up your website to use the X7 Chat cookies and database, or you can set up X7 Chat to use your web sites cookies and database.
Report to moderator   Logged
Dcoach
Member
*
Offline Offline

Posts: 8


View Profile Email
« Reply #2 on: January 07, 2005, 06:33:36 PM »
Reply with quote

OK, I think I get that.  I'll use the x7 cookies.  

But I'm still wondering about the login.  
Can I assume that if the cookie has expired, or is not there, then they are not logged in?  And the converse, that if the cookie is there, then they are logged in? (this may be obvious, but I'm really new to this game)
Thank-David
Report to moderator   Logged
E-Oreo
Administrator
Member
*****
Offline Offline

Posts: 3710


View Profile Email
« Reply #3 on: January 10, 2005, 07:33:36 PM »
Reply with quote

If the cookie expires then it will be deleted.  If the cookie is not present it means they are not logged in.  If a cookie is present it does not necessarily mean they have logged in, it just means username/password data is available for you to check.  You should never assume that just because there is a cookie that they are logged in, faking a cookie is very easy.  If you detect a cookie the next step is to check it to see if the username/password are correct, then if it is they are logged in.
Report to moderator   Logged
Pages: [1] Reply Send this topic Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.105 seconds with 15 queries.