Problems staying logged in with Opera Thread last updated on 2004-06-18 00:06:10

Posted by member 172195 on 2004-06-14 05:22:01

Hi,
there seem to be problems with your site and Opera. I am using a fairly recent version of Opera (7.20) and keep getting thrown back to the login page. I do not exceed the timeout of 15 minutes, this happens even on the first click after logging in. An example is logging in and then clicking in the "Themes" links -> instant logout.
As far as I know, Opera is fully standards compilant, so chances are, that the error is on the site and not in the browser. So please have a look into it, as I hate to have to use Internet Explorer in order to get this site working.

Posted by member 12798 on 2004-06-14 09:03:48 link

must be somehow related to your settings (cookies or whatever), because if you think you're the only one to use opera, that's not the case. ;)

Posted by member 1 on 2004-06-14 12:32:52 link

If you are not exceeding the timeout then it could be a problem where your IP address is changing since we verify the ip from the session info. You will also want to make sure that Opera is checking the site for new information on every visit and now pulling it from cache.

Posted by member 172195 on 2004-06-15 09:23:50 link

Yes, you're right. I had set up Opera to only check sites for changes every hour and since clicking on a like with entered password is not different from clicking on it without being logged in, Opera will return the cached site and it will seem like an instant logout. Thanks for your help.

Posted by member 45025 on 2004-06-16 00:44:04 link

Sorry to go OT, but simply getting the login page to return you to whatever page you were trying to get to after you have timed out and logged in again would make it much less annoying & it wouldn't take much to do.

Sorry if it has been suggested before too but I'll be damned if i'm going to trawl to see if has already been suggested.

Posted by member 172195 on 2004-06-16 06:32:26 link

Also it is not quite clear to me, why it is impossible to make part of the page available without logging in. But I guess, you already discussed this in a lot of topics and there is no other options...

Posted by member 12798 on 2004-06-16 13:43:26 link

right, there're approximately 2^1024 threads about this...

Posted by member 1316 on 2004-06-16 18:04:24 link

"I'll be damned if i'm going to trawl to see if has already been suggested"
do you really expect some sort of answer with that kind of attitude?

Posted by member 45025 on 2004-06-17 00:16:06 link

deuce; I didn't mean it to sound like that, one too many beers last night; Sorry.

I know there is a stipulation in the hosting plan which is why we cant stay logged in all the time, or have session logins (which is still stupid but I know it isn't going to change), but I thought I may offer a suggestion that could potentially ease the pain and number of threads on the topic.

Posted by member 45025 on 2004-06-17 00:54:50 link

I've just noticed that although the search feature is "disabled" (hence the unintentionally arsy sounding comment) we can still search by the box at the header of the topic list pages. So, after looking through a couple of threads searching for login, I noticed that devilboi said "As for remembering where you were, its not possible in the current setup."

I'm not sure if it was devilboi who coded the site or not, but I have noticed that you are using a controller type paradigm (i.e. everypage gets routed through one page and based on parameters either gets logged out, or, the script includes the relevant behind-the-scenes files to display the appropriate page...

With this in mind (assuming the setup hasnt changed since devilboi posted that, and you are using PHP 4.x.x/ 5) then it would be very easy to modify the controller gateway page (index.php) to "remember" where you came from.

I would be more than happy to provide some PHP code that you can adapt to fit your setup if you don't have the time.

Posted by member 1 on 2004-06-17 02:19:33 link

With a good amount of coding time...yeah...it could be done with a bunch of variable passing...but with the current setup it can't just be plopped in. Currently our main web dev is working on a rewrite of most every section and this ends up low on the priority list.

Posted by member 45025 on 2004-06-17 13:35:06 link

actually, it could be done quite shortly; Maybe not the most technically correct method but it should work.

Store the referring url in a hidden field in the login form.
Check if the variable is set just after the login.
If it is, firstly you would need to check that the referring url came from this site so that you don't throw people out who came in from a link then send a redirect header using the url in the hidden field.

Code might look something like this;
In the login page/template:
echo '";

The redirect bit would look something like:
if(isset($_REQUEST['_ref']) && !empty($_REQUEST['_ref']))
{
$urlParts = parse_url($_REQUEST['_ref']);
if(strcasecmp($urlParts['host'], "litestep.net") == 0)
header("Location: " . $_REQUEST['_ref']);
}

I haven't tested this code since I recently re-installed and don't have my dev server up but it should work.

*edit*
I think i should also add that it wont really work for forum posts and such; You would still have to go back because it is just a workaround solution but it is better than nothing.

Posted by member 1 on 2004-06-17 13:48:59 link

I am almost 99% sure that the referring URL is not the page you came from so it wouldn't work. I am pretty sure that the referring URL on the login page would be the logged out info and not the page you wanted to see.

Posted by member 45025 on 2004-06-17 14:40:11 link

Eck, dunno what i was thinking because you are correct ... referrer wouldnt work, simply because it isnt the refering page they are tryng to get to... It is the current URL they are trying to get to.

Infact, you can use the way your login system works to your advantage....

Ignore the code snippet in the last post; Simply use the current URL as the form post page.

I assume since all pages are routed through index.php and the login page is index.php that any page can be used as login.

I'll elaborate on this later if required since im late for work now.

Posted by member 45025 on 2004-06-18 00:06:10 link

Simply use this code to echo the current URL in to the action field of the login form...

<form name="LsLogin" action="<?php echo "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"; ?>" method="POST">

Sorry if I seem persistent but assuming this works It should make a few people happier.

Also, bear in mind that I'm only going by assumption on how your base code works, from a frontend perspective.