News:

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

Main Menu

Session Ends after JavaScript Redirect

Started by Nicky English, February 18, 2014, 11:54:12 AM

Previous topic - Next topic

Nicky English

Hey fellas,

I am trying to redirect users from my root index.php to the /forum/index.php.

Currently in production I'm using a deprecated HTML redirect that works just fine, and users are still logged in after a re-direct.

<meta http-equiv="refresh" content ="5; url=url">

However in my staging environment I'm using a javascript redirect. This javascript redirect is also in an .html file, not .php. No sure if this could be the cause.

setTimeout("location.href = 'url';",10000);

The latter has an issue where users are now logged out and having to log back in every time.

Has anyone had experience with this sort of thing and is able to help? It would be massively appreciated.

Storman™

Not answering your question but any reason why the forum isn't actually in the root ?

Nicky English

Quote from: Storman™ on February 18, 2014, 12:13:28 PM
Not answering your question but any reason why the forum isn't actually in the root ?

Originally the idea was to keep the root independent for CMS integration.

Storman™

So is there any other application in the root now ?

Sorry to ask these questions but it's relevent, we need the full picture about what you have and what you want to achieve.

Nicky English

Quote from: Storman™ on February 18, 2014, 12:50:55 PM
So is there any other application in the root now ?

Sorry to ask these questions but it's relevant, we need the full picture about what you have and what you want to achieve.

No problem!

The new version (that does not work is here:

hxxp:derpfootball.com/staging/ [nonactive]

It's root only has the index.html, script.js and style.css files. No other applications or anything else.

Kindred

why are you trying to use a javascript redirect?

Until you have something sitting in the root that you really want seen, just redirect all calls to the root by using .htaccess
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Nicky English

Quote from: Kindred on February 18, 2014, 02:32:11 PM
why are you trying to use a javascript redirect?

Until you have something sitting in the root that you really want seen, just redirect all calls to the root by using .htaccess

My current index.html is in effect a landing page (which I'd like to use). Currently it's displaying random strings, with much functionality expansion planned.

Is there any documented trouble SMF has with JavaScript redirects? Not sure what I'm doing wrong here, since a simple HTML redirect works.

Advertisement: