vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How to know if non-cookie user is logged in? (https://vborg.vbsupport.ru/showthread.php?t=139969)

4bidden 02-20-2007 09:25 PM

How to know if non-cookie user is logged in?
 
I have modified my board so that there is a link in every users control panel to edit a custom setup page of theirs. The edit page for this is not part of the board (obviously) and the only way I am able to tell if a user is logged in is by checking $_COOKIE. If the user is not using cookies, the $_SESSION is still empty (yes, even after session_start). What method is being used to keep them logged in between pages when not using cookies?

How can I check if a user is logged in if I don't find $_COOKIE info?

4bidden 03-19-2007 03:35 AM

Bump..... seems like this is an easy question? How does vB keep users logged in between pages if cookies are disabled?

4bidden 03-25-2007 01:29 AM

Anyone?

nexialys 03-25-2007 01:42 AM

sessions are managed in the database. when a user login, or just browse the forum, it is tracked action by action in the sessions system... even without cookies... when someone have the cookies inactive, the session id is kept in the url... so the id is compared with the data in the database, keeping track of the active user.

there is no $_SESSION because vBulletin is not using the default PHP session management, it has its own session manager... you have to call $vbulletin->session to make the same, but also have to load the vBulletin API to make it work...

kkiely 03-29-2007 05:01 AM

I have this same problem. I am an amatuer when it comes to coding but I would that if VBulletin is able to keep sessions between pages without a cookie then VB must have a quick way of doing it - which means there must be a quick function or access to a file or something that can be put into a non-vb page. Am I right about this?

nexialys 03-29-2007 10:40 AM

sessions are kept inside vBulletin, so you have to load your page within vBulletin to be able to retrieve that information...

https://vborg.vbsupport.ru/showthread.php?t=132996 can be helpful for you then.

kkiely 03-29-2007 09:24 PM

that page is just a variation of the non-vb login that uses the

if ($vbulletin->userinfo['userid']!=0) {

line to check for a cookie. If sessions are carried from page to page within VB then I'm wondering if anyone has found a way to clone that ability outside vb through an include or function or someething.

WetWired 03-29-2007 09:46 PM

Well, you could manually match the session in the link with the sessions table joined with the user table, but if you don't use the vB backend to do it, the session is likely to expire while the user is doing non-vB stuff.


All times are GMT. The time now is 08:04 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.00998 seconds
  • Memory Usage 1,719KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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