News:

Wondering if this will always be free?  See why free is better.

Main Menu

Will not stay logged in

Started by spark81, February 02, 2010, 06:15:39 PM

Previous topic - Next topic

spark81

When changing between pages on my forum when using Internet Explorer users are told they are not logged in or they are just displayed as a guest.

www.krazydubclub.com

I have checked all other Internet Browsers and the problem seems to just be with IE, anyone got any ideas what maybe causing this?

I have just had a look at the errors reports and seems to have the following critical error displayed many times

Wrong value type sent to the database. Integer expected. (p_total_time_logged_in)

Is this what is causing the problem and if so what do I need to change

YogiBear

Hi spark81,

If you're using IE8 try Compatability View.
SMF v2.1.3  Mods : Snow & Garland v1.4,  PHP  v.7.4.33

spark81

I have tried IE Explorer compatibility mode already but has not resolved the issue.

I am now thinking that this error is the actual cause but I am not sure what to do to get this corrected.

Wrong value type sent to the database. Integer expected. (p_total_time_logged_in)


spark81

OK this problem seems to be getting worse by the day

I am even unable to login myself and if I am when I try to goto another page on the forum it logs me out again and then will not reconise my password or username.

The problem is definatly isolated to IE though.

greyknight17

Did you make any changes to your forum before this problem occurred? Check your forum error log and see if there is anything there that may help us out.

I just tried to register and see that it requires approval. Just delete it...you will see which one is the test account.

One problem that I see which may be causing these issues is that you are using a frame. If possible, remove it and there is also an extra spacing on top (perhaps from the frame window as well) that can/will cause problems.

spark81

Hi thanks for the help with this.

When you say frame is this to do with the masking of the URL address?

Also you say spacing at the top I'm not to sure what you mean can you explain a little more please

flying_split

Hey there I m the one having the "Wrong value type sent to the database. Integer expected. (p_total_time_logged_in)"  and I can confirm this is not an explorer error.  as I use only firefox and safari. It is strange it doesnt actually log me out but anytime I try and perform an action such as post a post or approve an account etc I get the error and the action has not been performed. but I remain logged in ? Its a bit of a strange one and stranger that it comes now with a simple change of server.

spark81

My problem seems to be with the highlighted red section below, any ideas as this continues to display as a critical error

Integer expected. (p_total_time_logged_in)

Code from the subs.php file

'id_theme', 'is_activated', 'id_msg_last_visit', 'id_post_group', 'total_time_logged_in', 'warning',
   );
   $knownFloats = array(
      'time_offset',
   );

   $setString = '';
   foreach ($data as $var => $val)
   {
      $type = 'string';
      if (in_array($var, $knownInts))
         $type = 'int';
      elseif (in_array($var, $knownFloats))
         $type = 'float';
      elseif ($var == 'birthdate')
         $type = 'date';

      // Doing an increment?
      if ($type == 'int' && ($val === '+' || $val === '-'))
      {
         $val = $var . ' ' . $val . ' 1';
         $type = 'raw';
      }

      // Ensure posts, instant_messages, and unread_messages don't overflow or underflow.
      if (in_array($var, array('posts', 'instant_messages', 'unread_messages')))
      {
         if (preg_match('~^' . $var . ' (\+ |- |\+ -)([\d]+)~', $val, $match))
         {
            if ($match[1] != '+ ')
               $val = 'CASE WHEN ' . $var . ' <= ' . abs($match[2]) . ' THEN 0 ELSE ' . $val . ' END';
            $type = 'raw';
         }
      }

      $setString .= ' ' . $var . ' = {' . $type . ':p_' . $var . '},';
      $parameters['p_' . $var] = $val;
   }

   $smcFunc['db_query']('', '
      UPDATE {db_prefix}members
      SET' . substr($setString, 0, -1) . '
      WHERE ' . $condition,
      $parameters
   );

   updateStats('postgroups', $members, array_keys($data));

   // Clear any caching?
   if (!empty($modSettings['cache_enable']) && $modSettings['cache_enable'] >= 2 && !empty($members))
   {
      if (!is_array($members))
         $members = array($members);

      foreach ($members as $member)
      {
         if ($modSettings['cache_enable'] >= 3)
         {
            cache_put_data('member_data-profile-' . $member, null, 120);
            cache_put_data('member_data-normal-' . $member, null, 120);
            cache_put_data('member_data-minimal-' . $member, null, 120);
         }
         cache_put_data('user_settings-' . $member, null, 60);
      }
   }
}

// Updates the settings table as well as $modSettings... only does one at a time if $update is true.
function updateSettings($changeArray, $update = false, $debug = false)
{
   global $modSettings, $smcFunc;

   if (empty($changeArray) || !is_array($changeArray))
      return;

   // In some cases, this may be better and faster, but for large sets we don't want so many UPDATEs.
   if ($update)
   {
      foreach ($changeArray as $variable => $value)
      {
         $smcFunc['db_query']('', '
            UPDATE {db_prefix}settings
            SET value = {' . ($value === false || $value === true ? 'raw' : 'string') . ':value}
            WHERE variable = {string:variable}',
            array(
               'value' => $value === true ? 'value + 1' : ($value === false ? 'value - 1' : $value),
               'variable' => $variable,
            )
         );
         $modSettings[$variable] = $value === true ? $modSettings[$variable] + 1 : ($value === false ? $modSettings[$variable] - 1 : $value);


I am using the following

SMF 2.0 RC2 with the following mods

1      EzPortal      0.3.4      
2.    Add Favicon.ico Support    1.101    
3.    Aeva Media    1.0 Beta 5    
5.    PortaMx v0.971    0.971    
6.    Remove SMF Logo    1.301    
9.    SMF Articles    1.0.2    
10.    SMF Arcade    2.5 RC1    
11.    Contact Page    2.0    
12.    Google Search Box With Results    1.2    
13.    FantasticSmileys    1.0    
14.    Enhanced PM Popup    1.0.1    
15.    Dynamic_Memberlist    2.0.2    
16.    Custom Tab    1.2    
17.    Set the default session length for login    1.0

Kays

Can you pleae attach Subs.php to a post so we can have a look at it?

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

spark81

I have attached the sub.php file as requested, Thanks for helping with this

Kays

That looks normal. The function it is failing in is the one which updates the member's data. So, it could be anyhere. I'm suspecting a mod, But couldn't find anything in the likely suspects.

Look at the error message in the error log. Part of that is the url that caused the error There should be an "action" and maybe a "sa" in the address. What is the address after index.php?. That might help locate the file the error is coming from.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

spark81

This is all the information from the error log.

Apply Filter: Only show the error messages of this member  Flying_pikey
Apply Filter: Only show the error messages of this IP address 92.27.223.203 
     Reverse chronological order of list Today at 05:20:26 AM
Apply Filter: Only show the error messages of this session 775b6891ea388fdb0a01231d2fbbc3fb
Apply Filter: Only show the errors of this type Type of error: Critical
Apply Filter: Only show the error messages of this URL
http://krazydubclub.ilikethose.com/index.php?topic=3964.msg35184;topicseen
Apply Filter: Only show the errors with the same message
Wrong value type sent to the database. Integer expected. (p_total_time_logged_in)
Function: updateMemberData
Apply Filter: Only show the errors from this file
File: /home/content/s/p/a/spark81/html/krazydubclub/Sources/Subs.php
Line: 534


miikka_

#12
Hi Spark.

Did you already solve the problem? I am suffering exactly the same issue. Only mods I have is a custom theme modified by myself. And the symptoms are the same like you have. The forum has been online two days now and error log is 30 pages long.

Errors are like:

8: Use of undefined constant brkdmrcnmenu - assumed 'brkdmrcnmenu'
8: Undefined index: brkdmrcnistatistik
8: Use of undefined constant brkdmrcnistatistik - assumed 'brkdmrcnistatistik'
8: Undefined variable: current_action
And below every error is this kind of error message which refers to the theme file but I don't understand what's the problem with it.
"File: /home/XXX/public_html/forum/Themes/default/Themes.template.php (main_below sub template - eval?)"

And so on.

The only file I've changed for the theme is the index.template, but even if I upload the original one and replace the modified it won't change the situation.

I also tried to use the default theme of SMF but the problem still stays.

Edit: Finally solved. The solution was easier than thought. In server settings my forum URL was written without the www, and in everywhere else it was written with it. So added www. to settings URL and it's running like it should.

spark81

Hi I'm not sure if you are having the same issue but I did get this sorted.

The problem was from within the users data in PHpMyAdmin, the problem being the time being greater than
the time the forum had existed so all I done was change the user logged in time to 0

Advertisement: