Announcement

Collapse
No announcement yet.

Session created

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Forum] Session created

    Where can i find the code that creates/initializes a session when sombody enters the site? I did a `grep "session_start" -R *` in the forum directory but didnt find anything so i guess vb is creating/initializing it's own session.

    Also, how can i store/read vb's session data similar to the $_SESSION['var'] in PHP?
    NDCHost.com <-- We support vbulletin installs!

  • #2
    Hi,

    You can use the vB_Session class - http://members.vbulletin.com/api/vBu...B_Session.html

    Session data can be accessed using $vbulletin->session->vars, e.g. $vbulletin->session->vars['useragent'] for the useragent etc,.

    Regards,

    Mosh.
    -- Wolfshead Solutions - Closed down permanently as of 1/7/2013.
    -- As of 1/7/2013, due to medical reasons I no longer support my vbulletin.org hacks as I have left the vBulletin community.
    -- My Free vBulletin.org Hacks

    Comment


    • #3
      So then is a session only started/created on login?

      What i'm looking to do is track where a user who is registering entered my site from.

      Normally i would have somthing like this in a global.php or the first few lines of each page.

      PHP Code:
      <?
      if(!session_id()) session_start();
      if(!
      $_SESSION['referer']) $_SESSION['referer'] = $_SERVER['HTTP_REFERER'];
      ?>
      Then on the registrarion email that gets sent out to notify the admin if a new user i would include $_SESSION['referer'].
      NDCHost.com <-- We support vbulletin installs!

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...
      X