SSI, return to the page after login (not the board index)

Started by MultiformeIngegno, March 28, 2010, 07:00:10 PM

Previous topic - Next topic

MultiformeIngegno

Hello! :)
I've some pages that loads ssi stuff, all is working properly, except that if an user logs in in that page, instead of remain there he's redirected to the board index... is it possible to remain in the page after login instead of been redirected to the board index?

Thanks!! ;)
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Oldiesmann

Yes. Just set $_SESSION['login_url'] to whatever URL you want them sent to before you call ssi_login().
Michael Eshom
Christian Metal Fans

MultiformeIngegno

Thanks... however I can't test this because I noticed that everytime I login from my ssi pages (that work properly, all is displayed fine!) I receive a "password wrong" error, also if it's right... then I'm redirected to the forum login and there it works... instead if I logout I receive a "session error".. don't know why..

Here's my code:

<?php
error_reporting
(E_ALL);

// Specify the page context
$_GET['action'] = 'extra';
$context['faqpage'] = true;
$context['page_title'] = 'FAQs';

$context['outside_forum'] = true;
$ssi_maintenance_off true;

// Layers to be utilized
$ssi_layers = array('html''body');

// Change "true" to "false" to disable Gzip if not supported on your server
$ssi_gzip true;

//This is the SSI.php file in the Board dir.
require('../forum/SSI.php');

// Track stats
trackStats(array('hits' => '+')); trackStats();

writeLog(true);
?>



These pages are in a subdomain. So, as said many and many times here I've disabled local storage for cookies, enabled subdomains indipendent cookies, and set database driven sessions on.

What's wrong..?
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Arantor

So what URLs are being called when this is happening?

Like what link is being called for logout?

MultiformeIngegno

Quote from: Arantor on March 29, 2010, 07:28:41 AM
So what URLs are being called when this is happening?

Like what link is being called for logout?
My forum url is: forum.rockciclopedia.com. Let's say we're here: extra.rockciclopedia.com (a ssi page). If I try to login using the box there, I'm redirected here: http://forum.rockciclopedia.com/index.php?action=login2 with the "password wrong" error. If there I re-insert my login details (the same!) I can login successfully!
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Arantor

So what version of SMF?

And for logout, what link does that go to?

MultiformeIngegno

RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Arantor

And is that link the same link the logout button in the regular forum has?

MultiformeIngegno

No... the one on extra.rockciclopedia.com is: http://forum.rockciclopedia.com/index.php?action=logout;e29c8019d43=a88ce234f58bccf613a348c352c97eb1

The one on the forum is: http://forum.rockciclopedia.com/index.php?action=logout;d9176df5882=21fba82e5437e4904e9546e412d6f916

...anyway if I return to extra.rockciclopedia.com without loggin out, and I copy the link from the "logout" button it has changed again, now is: http://forum.rockciclopedia.com/index.php?action=logout;fd3ec93396=eacf4dc19d77c381da1803f11d94f9ef

On the ssi pages it changes at every refresh, instead the forum one remains always the same (until the session gets expired, of course)!
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Arantor

So sessions aren't being kept properly. Sure you have subdomain independent cookies on?

MultiformeIngegno

Quote from: Arantor on March 29, 2010, 09:07:26 AM
So sessions aren't being kept properly. Sure you have subdomain independent cookies on?
Sure!
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

MultiformeIngegno

I've noticed another (related) thing.. sometimes smf "forgets" the session and kick me out, so I need to login another time!
For example if I'm writing a post and I wait.. don't know... 5 minutes.. then I can't post because the session is expired!  ???

Strange! And it's strange also that the session "number" changes every time I refresh the page when I'm on a ssi page..
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Arantor

I'm kinda curious - where did all that code come from? You only actually *need* the include to SSI.php followed by a call to template_header() and a call to template_footer() and you're done really. Everything else is just trappings.

In fact, create a tiny page in that form and see what session ident you get in the displayed logout link....

MultiformeIngegno

I've created a new file with only this:

<?php
//This is the SSI.php file in the Board dir.
require('forum/SSI.php');

template_header();

template_footer();
?>



The same behavior... I'm redirected to the forum login with the "password wrong" error!
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Arantor

And is the link consistently different in the logout link when you refresh the page?

MultiformeIngegno

Quote from: Arantor on March 29, 2010, 03:27:26 PM
And is the link consistently different in the logout link when you refresh the page?
No, this time the logout link is the same also if I refresh the page.. anyway if I click it I get always the "session verification error"...
So, using this code the logout link in the ssi page remains the same, like the forum one, that remains the same (but they're different).. I can't understand why there's this conflict!!
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Arantor

Log out - from the forum, and ensure every cookie you have is removed for your site.

Then log back in and see what happens.

MultiformeIngegno

Quote from: Arantor on March 29, 2010, 04:04:00 PM
Log out - from the forum, and ensure every cookie you have is removed for your site.

Then log back in and see what happens.
Already tried.... the same!
I've tried also in "private browsing" or with other computers/browsers, the same..
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

chilly

I have had an error on my site looking exactly the same.
But my problem was solved with deleting every cookie i got for my site (there where cookies for different subdomains + subdomain-independent)
After that everything was fine.

Language Coordinator

MultiformeIngegno

Quote from: chilly on March 30, 2010, 05:16:50 AM
I have had an error on my site looking exactly the same.
But my problem was solved with deleting every cookie i got for my site (there where cookies for different subdomains + subdomain-independent)
After that everything was fine.
I've deleted all my cookies (I've also tried with the "private browsing"), but it's the same..
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Advertisement: