vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Having trouble setting login sessions. (https://vborg.vbsupport.ru/showthread.php?t=203529)

jon.braswell 01-29-2009 08:02 PM

Having trouble setting login sessions.
 
I am working on a site that has a members area, and this members area has a vBulletin forum that is only accessible by members. I am trying to automatically login these users to the vBulletin forum when they login to the members area.

I've written some code to set the cookies 'bbuserid' and 'bbpassword', but it doesn't seem to be working. I am obviously missing something, but not sure what, and I am not sure where to look to find out.

This is what I have written to set the cookies...

Code:

if(!$result = mysql_query("SELECT userid, password FROM user WHERE username='".$_POST['vb_login_username']."'")) {
    echo mysql_error();
    exit;
}
if(mysql_num_rows($result) > 0) {
    $row = mysql_fetch_array($result);
    $license_num = "...";
    setcookie("bbuserid", $row['userid']);
    setcookie("bbpassword", md5($row['password'].$license_num));
}

Any insight into why this isn't working would be GREATLY appreciated.

Thank you!

Dismounted 01-30-2009 04:14 AM

Look at the vBulletin login process in login.php, and also functions_login.php.


All times are GMT. The time now is 04:49 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01011 seconds
  • Memory Usage 1,708KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete