News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Going back to last page viewed when logging in?

Started by Gryzor, June 06, 2011, 01:51:14 AM

Previous topic - Next topic

Gryzor

Hello!

My users complained that after the last upgrade (from rc2 to rc5), when they log in from a page they are reading they're dropped to the forum's homepage instead of going back to the page they were reading... I'm not sure it was different before (I'm always logged in), but it'd make much, much sense for it to be so...

Any ideas?

Thanks,
T

Gryzor

Anyone? :) Sorry for the bump, I would think that this is quite important from the usability POV...

Miles Marshall

Gryzor,

I just tested it on my forum. I'm reading one of the posts (While being logged out) Then I log back in and I still see what I'm reading I'm still on the tread that I was reading when I was logged in.

Run a maintence real quick
Need Computer Help? Just want to chat? Come on over! http://www.geekinc.org
"I tried to fix the world but they wouldn't give me the source code"

-Miles

Gryzor

Hmmm then it's just me, dammit... I just run all maintenance, same thing. Probably something to do with cookies, but what? :(

www.cpcwiki.eu

Miles Marshall

It's not just you I just signed up for your site real quick and it's doing it to me to .. hmm
Need Computer Help? Just want to chat? Come on over! http://www.geekinc.org
"I tried to fix the world but they wouldn't give me the source code"

-Miles

Illori


Miles Marshall

Shouldn't it work without having to install the mod? I'm on SMF 2.0 RC5 and it works for me.
Need Computer Help? Just want to chat? Come on over! http://www.geekinc.org
"I tried to fix the world but they wouldn't give me the source code"

-Miles

Gryzor

@Miles: yeah, by "me" I meant "my forum". Thanks for checking it out...

@Illori: thanks, that's so short I can install it manually anyway, but it's somewhat puzzling: if that's what the forum would normally do, why is there a mod for it?

@Miles (again): ack, you posted while I was typing. Exactly!!!

Illori

i have never logged in on any other page then the main page that i can recall so i can not confirm if this happens on other forums, but as far as i know it is not a default feature.

Miles Marshall

I myself find when I login to the forum on the site go to a topic and read it, logout then back in I go back to the forum index. But when I attempted it on mine I just stayed in the same thread I was reading

No mods installed so you shouldn't need it..
Need Computer Help? Just want to chat? Come on over! http://www.geekinc.org
"I tried to fix the world but they wouldn't give me the source code"

-Miles

Illori


Gryzor

#11
Yeah, I hadn't tried it either, but my users told me so... so I can't confirm it first-hand.

From OP: RC5.

I just took a look at sources/LogInOut.php. It says, in the comments:

Quote
   void Login()
(...)- caches the referring URL in $_SESSION['login_url'].
(...)
   void Login2()
      - after successful login, redirects you to $_SESSION['login_url'].

So it *should* be like that, but it's not working...?

[EDIT] I run a diff between the original file and my own. It seems the culprit is enotify, since it's the only difference and it replaces

if (empty($_SESSION['login_url']))

with

if ((!empty($_SESSION['login_url']) && strpos($_SESSION['login_url'], 'enotify')) || empty($_SESSION['login_url']))

I don't see why it wouldn't work, but I'll report it in the mod's support page.


Advertisement: