flyalaska Posted September 2, 2012 Report Posted September 2, 2012 We are upgrading our chat to ArrowChat. We trying to integrate it with our database. Ran into a wall. Having problems with the sessions. The chat script wants the data from the cookie. We can change that from cookie to session without a problem. Just don't know what the variables are. Any help would be appreciated. Quote
flyalaska Posted September 2, 2012 Author Report Posted September 2, 2012 $_COOKIE Thanks, we have that one already, we need to try and find out what the session variable is for the pilot ID, this way we can match who is currently logged in to the database and then allow the chat for the member pilots only Quote
Moderators Kyle Posted September 2, 2012 Moderators Report Posted September 2, 2012 You can include the phpVMS Codon.Config .php and use the Auth Classes to work it. Once you done that, use the Auth::$userinfo->pilotid for the session if you can. Quote
Administrators simpilot Posted September 2, 2012 Administrators Report Posted September 2, 2012 If you are trying not to include the core config file to avoid conflicts and they are using the remember me function when they login you should be able to grab their cookie using $_COOKIE['VMSAUTH'] and find something like this ["VMSAUTH"]=> "24|1|127.0.0.1" The second position is their raw pilot id number from the database. If they are not using the remember me function you are going to have to grab the session id out of the cookie and match the id to a session id in the sessions atble of phpVMS and then get the pilot id from there. Quote
HighFlyerPL185 Posted July 26, 2013 Report Posted July 26, 2013 Is there any chance you could expand on this please? I've ran into a brick wall, I'm trying to develop something outside of phpVMS, and the session is not being carried over. <?php include_once'/home/srv/public_html/core/codon.config.php'; session_set_cookie_params(0, '/', '.site_url.com'); session_start(); if(Auth::LoggedIn()) { header("Location: crew_center.php"); } else { header("Location: login.php"); } ?> When the user is logged in, it should show him crew_center.php page, but instead it is showing the login page. It works however when you enter the direct folder path in the browser. How and where would I use the $_COOKIE['VMSAUTH'] ? Quote
Fernando Posted July 27, 2013 Report Posted July 27, 2013 Is there any chance you could expand on this please? I've ran into a brick wall, I'm trying to develop something outside of phpVMS, and the session is not being carried over. <?php include_once'/home/srv/public_html/core/codon.config.php'; session_set_cookie_params(0, '/', '.site_url.com'); session_start(); if(Auth::LoggedIn()) { header("Location: crew_center.php"); } else { header("Location: login.php"); } ?> When the user is logged in, it should show him crew_center.php page, but instead it is showing the login page. It works however when you enter the direct folder path in the browser. How and where would I use the $_COOKIE['VMSAUTH'] ? I too, am trying to configure this arrowchat to my website, But I'm following the information as the topic belo http://forum.phpvms.net/topic/8649-arrowchat-solved/page__hl__arrowchat__st__20 So far I have not succeeded Quote
HighFlyerPL185 Posted July 27, 2013 Report Posted July 27, 2013 I'm doing something else outside phpVMS, but I believe a cookie might solve my issue. A subdomain basically does not carry over the session from phpVMS. You login on the subdomain, it logs you in phpVMS, but it does not work on the subdomain. Works if you type in the direct link though :S Quote
Administrators simpilot Posted July 28, 2013 Administrators Report Posted July 28, 2013 Sharing cookies across subdomains can be a complete pain in the a$$, especially in IE. If I were you I would simply set your own cookie using a check directly against the database. Grab the cookie from the user, if it is there, and check it against the phpvms database and if it is good set your own cookie for the user to carry through your standalone application. If the cookie is not there you are pretty much out of luck. I am not sure what you are doing but if you are just wanting different pages for phpvms that are not in the format of the skin being used you can use action.php instead of index.php. This will give you access to all the phpvms functionality but will be skinless. You can add completely different designs to every page called this way. I have done this in the past for VA's that wanted individual hub pages that differed from the main site look but wanted access ot the functionality of the backend of phpVMS. Quote
HighFlyerPL185 Posted July 30, 2013 Report Posted July 30, 2013 Disregard, I got it working in the end. Thanks Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.