Announcement

Collapse
No announcement yet.

[How the right way to write it] Make cookietimeout different for member & guest

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

  • [How the right way to write it] Make cookietimeout different for member & guest

    I want to set cookietimeout
    for guest : 600
    and for member : 9000


    - So i emptied the value in admincp > vboptions > Cookies and http header options > Session timeout



    - then i open includes/init.php file

    I already tried replace these lines

    PHP Code:
    if ($vbulletin->options['cookietimeout'] < 60)
    {
        
    // values less than 60 will probably break things, so prevent that
        
    $vbulletin->options['cookietimeout'] = 60;






    with this

    PHP Code:
    if ($vbulletin->userinfo['userid'] == 0)
    {
    $vbulletin->options['cookietimeout'] = 600;
    }
    else
    {
    $vbulletin->options['cookietimeout'] = 9000;






    or this

    PHP Code:
    if (is_member_of($vbulletin->userinfo267))
    {
    $vbulletin->options['cookietimeout'] = 9000;
    }
    else
    {
    $vbulletin->options['cookietimeout'] = 600;







    But its looks still not right, member looks like still using cookietimeout 600

    Please help, how is the right way to make/write this

    Nb. I am using vb 3
    Build community is not easy, its a very long game

  • #2
    What is the goal behind this? Users, if they check remember me,w ill stay logged in until they log out.
    Code modifications should be discussed at vBulletin.org

    Comment


    • #3
      Originally posted by Zachery View Post
      What is the goal behind this? Users, if they check remember me,w ill stay logged in until they log out.
      Code modifications should be discussed at vBulletin.org
      the goal is longer session time for member, and less session time for guest,
      in session table, so less load for server


      yes i already ask in vb.org too, i want to ask in this PHP & HTML forum too if allowed, maybe someone here can help too
      Build community is not easy, its a very long game

      Comment


      • #4
        I haven't looked too closely but i'd guess the code doesn't work because vb sets the session timeout BEFORE knowing which usergroup the visitor is in.

        Comment

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