vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Set session outside vB (https://vborg.vbsupport.ru/showthread.php?t=158805)

Kaitlyn2004 09-26-2007 10:44 AM

Set session outside vB
 
I have a whole bunch of systems which integrate with vB but they still require you to log in separately.

Is there a way to set minimum session data to "log in" to vB? I know there is tons in the session array but can i set just a few to have them be logged in?

Dismounted 09-26-2007 10:47 AM

PHP Code:

$password md5(md5($password) . $salt);

setcookie(COOKIE_PREFIX 'userid'$useridtime() + 14400);
setcookie(COOKIE_PREFIX 'password'md5($password $license), time() + 14400); 


Kaitlyn2004 09-26-2007 11:33 AM

Quote:

Originally Posted by Dismounted (Post 1347451)
PHP Code:

$password md5(md5($password) . $salt);

setcookie(COOKIE_PREFIX 'userid'$useridtime() + 14400);
setcookie(COOKIE_PREFIX 'password'md5($password $license), time() + 14400); 


What about just for the session?

ianskate 09-26-2007 07:01 PM

yeah that doesnt tell you anything about setting the session. im doing the same thing currently, and just setting the cookies for userid and pw doesnt do much, vBulletin still thinks you arent logged in.

you need a bbsessionhash cookie which matches the session hash found in a row created in the _session table. unfortunately, vb has a very complex way of creating the id hash/sessionid. ive been searching the forums literally all day and pleanty of people talk about it, but no one shows how its actually done. so im resorting to digging through the source in order to find it. so far ive at least found away to create the idhash in the session table. Im having problems figuring out all the variables used in the sessionhash itself.

Dudsmack 09-26-2007 11:44 PM

Quote:

Originally Posted by ianskate (Post 1347736)
ive at least found away to create the idhash in the session table.

How do you generate the idhash?


The session hash is read from the cookie bbsessionhash - I know that's not how it's made but I hope that helps.

reebosak 01-09-2008 06:58 PM

Quote:

Originally Posted by Dudsmack (Post 1347859)
How do you generate the idhash?

PHP Code:

$idhash md5$_SERVER['HTTP_USER_AGENT'] . $subnet ); 

where $subnet is the class C network of the remote IP that vbulletin sees.

for example:
My IP : 192.168.1.111
$subnet will be 192.168.1


All times are GMT. The time now is 11:05 AM.

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.03024 seconds
  • Memory Usage 1,731KB
  • 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
  • (3)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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