11
ghia
Re: Moving a site, keeps logging out
  • 2009/11/30 10:00

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


If one operation (moving) fails, adding a second major operation (upgrade) is mosttimes only complicating the problems and making the solution more difficult.
Did you miss this?

12
ccairns
Re: Moving a site, keeps logging out
  • 2009/11/30 13:02

  • ccairns

  • Just popping in

  • Posts: 13

  • Since: 2008/10/16


Sorry ghia, I did miss your first post - I think it arrived when I was in the middle of posting a reply. In response to that one, as soon as you log in WITHOUT www it redirects to www anyway, and exhibits the same behaviour. I am using PHP5. I don't think I need any special operations for sessions, it seems like pretty bog standard Linux/Apache hosting to me - for what it's worth, my site is http://www.eesb.org.uk, hosted with ukhost4u.com.

I realise upgrading could have made it worse, but it seems to have gone smoothly and it was always worth a try. Nothing seems any more broken than it was before :) If you think it would help though, I have got a backup from immediately before I upgraded, I can always restore it.

Cheers,

Chloe

13
trabis
Re: Moving a site, keeps logging out
  • 2009/11/30 13:30

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Captcha is not working during registration. Keeps saying it is incorrect. I think you have a problem with sessions on your server. They do not persist.

14
ghia
Re: Moving a site, keeps logging out
  • 2009/11/30 14:03

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Also theme changes are not remembered.

So, there is something wrong with cookies or sessions.

Try following tests:
cookietest.php
<?php setcookie("MyCMS","XOOPS"); setcookie("MyColour","Blue"); print("<pre>n"); print("2 cookies are set.n"); $count = count($_COOKIE); print("$count cookies received.n"); foreach ($_COOKIE as $name => $value) { print " $name = $valuen"; } print("</pre>n"); ?>
Run it twice and the second time it should say:
2 cookies received
MyCMS=XOOPS
MyColour=Blue
(Additional cookies may be showing, but the point is that the My.... cookies show up at the second run.

Session test is with two files:
setsession.php
<?php session_start (); $ok = session_regenerate_id (); $sid = session_id (); $_SESSION ['MyCMS'] = "XOOPS"; ?> <html> <head> <title>Session test 1</title> </head> <body> <p> <b>Session created.</b> </p> <p> Session id regenerated: <?php print "$ok"; ?><br /> Session variable MyCMS set: <?php print $_SESSION ['MyCMS']; ?> <br /> Session id: <?php print "$sid"; ?>  </p> <p> <?php print "<a href="tstsession.php?sid=$sid">Check session variables</a>"; ?>  </p> </body> </html>

and tstsession.php:
<?php $sid = $_GET ['sid']; session_id ($sid); session_start (); ?> <html> <head> <title>Session test 2</title> </head> <body> <p> <b>Session Info</b> </p> <p> Session id: <?php print "$sid"; ?><br /> Session variable MyCMS: <?php print $_SESSION ['MyCMS']; ?> <br /> </p> </body> </html>

Result should be MyCMS: XOOPS
There should be no errors when running the programs.

What are your results?


15
ccairns
Re: Moving a site, keeps logging out
  • 2009/11/30 18:38

  • ccairns

  • Just popping in

  • Posts: 13

  • Since: 2008/10/16


Both tests ran fine (had to insert a few stray backslashes which have presumably been removed on posting). Man I'm glad you guys are here, I wouldn't have a clue how to test all this stuff!!

setsession.php:

Session created.

Session id regenerated: 1
Session variable MyCMS set: XOOPS
Session id: fa417ae776a0e435132c4227911b7746

tstsession.php:

Session Info

Session id: fa417ae776a0e435132c4227911b7746
Session variable MyCMS: XOOPS

cookietest.php:

2 cookies are set.
5 cookies received.
PHPSESSID = fa417ae776a0e435132c4227911b7746
eesbtest = 0
XOLOGGERVIEW = null
MyCMS = XOOPS
MyColour = Blue

16
ghia
Re: Moving a site, keeps logging out
  • 2009/12/1 0:18

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Quote:
had to insert a few stray backslashes
Grr stupid code window.

Very weird. Everything seems in place to run fine, but it doesn't.
A theme selection is also remembered in the session, and that get sometimes lost when selecting the forum or home in the menu. It returns then to the standard setting of the eesb-theme.

Do you see errors in debug mode?
Check out also the queries. It could be a database problem.
Do you have errors in the Apache or Protector logs?

17
Anonymous
Re: Moving a site, keeps logging out
  • 2009/12/1 9:46

  • Anonymous

  • Posts: 0

  • Since:


Stupid question:

Is your browser set to accept cookies?

18
ghia
Re: Moving a site, keeps logging out
  • 2009/12/1 10:19

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Yes, they are, see result of the cookie test above.

You can notice the problem yourself at his site. Select another theme. Do a few clicks on the menu and suddenly the theme is reset to the standard theme again. This means a loss of the session. Altough the session indentifier seems to stay the same.

19
ccairns
Re: Moving a site, keeps logging out
  • 2009/12/1 20:04

  • ccairns

  • Just popping in

  • Posts: 13

  • Since: 2008/10/16


I agree, it's all very weird. The only errors in the server logs are people trying to hack my website!! Ack. As for protector logs - where are they stored? Tbh I can't remember if it's even installed. Looks like it's first thing to do when everything's sorted though.

Debug mode is on in theory. You can only see messages when you're logged in (don't know why) so I can only offer the ones you see on the home page when you have your one page of login. Only these:

Warning: MyTextSanitizer::makeTareaData4Show is deprecated in file /class/module.textsanitizer.php line 851 (loads of this one)
Notice: Undefined offset: 1 in file /modules/multimenu/blocks/include/item.php line 73 (a few of these)

neither of which seem particularly relevant.

Queries I'm less confident with - see if you can spot anything dodgy:

le="color: #000000"><?php 0.000186 - SET SQL_BIG_SELECTS = 1 0.000419 - SELECT * FROM config WHERE (conf_modid = '0' AND conf_catid = '1') ORDER BY conf_order ASC 0.000424 - SELECT sess_data, sess_ip FROM session WHERE sess_id = 'f449b90785f21888548249a55defcc2e' 0.000617 - SELECT * FROM users WHERE uid = '1' 0.000181 - SELECT * FROM modules WHERE dirname = 'protector' 0.000308 - SELECT * FROM config WHERE (conf_modid = '0' AND conf_catid = '3') ORDER BY conf_order ASC 0.002120 - SELECT DISTINCT gperm_itemid FROM group_permission WHERE gperm_name = 'block_read' AND gperm_modid = 1 AND gperm_groupid IN (1,2,4) 0.002392 - SELECT b.* FROM newblocks b, block_module_link m WHERE m.block_id=b.bid AND b.isactive=1 AND b.visible=1 AND m.module_id IN (0,-1) AND b.bid IN (1,2,3,15,4,14,5,13,6,17,7,12,8,38,9,37,10,36,11,18,16,35,39,40,41,42,43,47,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,84,100,101,102,103,104,69,71,72,73,74,75,76,77,78,83,79,80,81,82,85,86,87,88,89,90) ORDER BY b.weight, m.block_id 0.000211 - SELECT * FROM modules WHERE dirname = 'extgallery' 0.001118 - SELECT * FROM group_permission WHERE (gperm_name = 'public_access' AND gperm_modid = '12' AND (gperm_groupid = '1' OR gperm_groupid = '2' OR gperm_groupid = '4')) 0.000790 - SELECT * FROM extgallery_publicphoto WHERE (cat_id IN (8,14,13,12,11,10,9,7,4,3,1,6,15,16,17,18) AND cat_id IN (7)) ORDER BY photo_date DESC LIMIT 0, 1 0.000192 - SELECT * FROM smiles 0.000210 - SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (tpl_tplset = 'eesb-theme' AND tpl_file = 'extgallery_block_last.html') ORDER BY tpl_refid (lotsa these) 0.001925 - SELECT image_dir FROM multimenu_menu WHERE status>=1 AND catid=4 AND ( title='' OR groups LIKE '%1%' OR groups LIKE '%2%' OR groups LIKE '%4%' ) 0.000200 - SELECT * FROM modules WHERE dirname = 'multimenu' 0.000150 - SELECT * FROM config WHERE (conf_modid = '23') ORDER BY conf_order ASC 0.001669 - SELECT * FROM multimenu_link WHERE catid=4 AND status>0 AND ( title='' OR groups LIKE '%1%' OR groups LIKE '%2%' OR groups LIKE '%4%' ) ORDER BY weight ASC 0.000205 - SELECT * FROM modules WHERE dirname = 'extcal' 0.000201 - SELECT * FROM config WHERE (conf_modid = '25' AND conf_catid = '0') ORDER BY conf_order ASC 0.000932 - SELECT * FROM group_permission WHERE (gperm_name = 'extcal_cat_view' AND gperm_modid = '25' AND (gperm_groupid = '1' OR gperm_groupid = '2' OR gperm_groupid = '4')) 0.000596 - SELECT * FROM extcal_event WHERE (((event_end >= '1259694454' AND event_isrecur = '0') OR (event_recur_end >= '1259694454' AND event_isrecur = '1')) AND event_approved = '1' AND cat_id IN (1) AND cat_id IN (3,2,1)) ORDER BY event_start ASC LIMIT 0, 10 0.000227 - SELECT * FROM modules WHERE dirname = 'smartsection' 0.000284 - SELECT * FROM config WHERE (conf_modid = '3') ORDER BY conf_order ASC 0.000591 - SELECT * FROM smartsection_items WHERE (categoryid = '5' AND (status = '2') AND datesub <= '1259694454') AND (summary IS NOT NULL AND summary <> ' ' ) ORDER BY datesub DESC LIMIT 0, 5 0.000217 - SELECT * FROM smartsection_categories 0.000240 - SELECT * FROM group_permission WHERE (gperm_modid = '3') 000333 - SELECT image_dir FROM multimenu_menu WHERE status>=1 AND catid=5 AND ( title='' OR groups LIKE '%1%' OR groups LIKE '%2%' OR groups LIKE '%4%' ) 0.000500 - SELECT * FROM multimenu_link WHERE catid=5 AND status>0 AND ( title='' OR groups LIKE '%1%' OR groups LIKE '%2%' OR groups LIKE '%4%' ) ORDER BY weight ASC 0.000191 - SELECT * FROM multimenu_query WHERE id=6 0.000210 - SELECT itemid, title FROM smartsection_items WHERE categoryid=6 ORDER BY weight ASC LIMIT 0, 10 0.000490 - SELECT * FROM modules WHERE dirname = 'pm' 0.013615 - SELECT COUNT(*) FROM priv_msgs WHERE (read_msg = '0' AND to_userid = '1') 0.000595 - SELECT * FROM smartsection_items WHERE (categoryid = '1' AND (status = '2') AND datesub <= '1259694454') AND (summary IS NOT NULL AND summary <> ' ' ) ORDER BY datesub DESC LIMIT 0, 5 0.000402 - SELECT image_dir FROM multimenu_menu WHERE status>=1 AND catid=6 AND ( title='' OR groups LIKE '%1%' OR groups LIKE '%2%' OR groups LIKE '%4%' ) 0.000551 - SELECT * FROM multimenu_link WHERE catid=6 AND status>0 AND ( title='' OR groups LIKE '%1%' OR groups LIKE '%2%' OR groups LIKE '%4%' ) ORDER BY weight ASC 0.000201 - SELECT * FROM multimenu_query WHERE id=7 0.000186 - SELECT itemid, title FROM smartsection_items WHERE categoryid=2 ORDER BY weight ASC LIMIT 0, 10 0.000352 - SELECT image_dir FROM multimenu_menu WHERE status>=1 AND catid=7 AND ( title='' OR groups LIKE '%1%' OR groups LIKE '%2%' OR groups LIKE '%4%' ) 0.000542 - SELECT * FROM multimenu_link WHERE catid=7 AND status>0 AND ( title='' OR groups LIKE '%1%' OR groups LIKE '%2%' OR groups LIKE '%4%' ) ORDER BY weight ASC


Oh, and one very important thing: not 'his' site but 'her' site, I'm this spectacular minger here: http://www.eesb.org.uk/modules/pageworks/index.php?page=4&name=Chloe+Cairns :)

20
ghia
Re: Moving a site, keeps logging out
  • 2009/12/2 0:48

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Quote:
I agree, it's all very weird. The only errors in the server logs are people trying to hack my website!! Ack. As for protector logs - where are they stored? Tbh I can't remember if it's even installed. Looks like it's first thing to do when everything's sorted though.
It is in the admin function of the module. If it is installed, you should see it in the module list. If not, top priority, especially with the people already trying...

Quote:
Debug mode is on in theory. You can only see messages when you're logged in (don't know why) so I can only offer the ones you see on the home page when you have your one page of login.
That is the intended behaviour.
Quote:
Only these:

Warning: MyTextSanitizer::makeTareaData4Show is deprecated in file /class/module.textsanitizer.php line 851 (loads of this one)
Notice: Undefined offset: 1 in file /modules/multimenu/blocks/include/item.php line 73 (a few of these)
The deprecated ones can be safely ignored.
But I have more doubts with the ones from multimenu. Could you disable once this module, to see if this helps?
Quote:
not 'his' site but 'her' site,
We don't differentiate on that here, but anyway, congratulations with your site.

Who's Online

133 user(s) are online (88 user(s) are browsing Support Forums)


Members: 0


Guests: 133


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits