News:

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

Main Menu

SSI login / logout

Started by djmentos, June 26, 2010, 05:23:21 PM

Previous topic - Next topic

djmentos

Hi.

I have a lot of problem with SSI and login and logout function.
Sessions are set on DB, local cookies are OFF, and subdomain independent - ON

Paths:
./forum/SSI.php
./panel/index.php - all i using here

index.php:
(logout)

<li><?php ssi_logout($_SERVER['REQUEST_URL']); ?></li>
<li><?php echo '<a href="/forum/index.php?action=logout;'.$context['session_id'].'">xxx</a>'?></li>
<?php } else { ?>

In my case (both variants are the same):
Create link:
forum/index.php?action=logout;f43058289ed=ed25a7cfdafd7046fe6ec5c61b6f1103

Board's logout link looks like:
index.php?action=logout;d31dc5853d6=6663c2424184719a6e0e37a004f49527

So there are two others sessions! Why? (When i try logout i get error with sessions verification failed caption)

Second problem is with redirect after login, its not works ;)

$_SESSION['login_url'] = $_SERVER['REQUEST_URL'];
echo '<form style="margin: 0 auto; width: 300px;" action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '">
<div style="float: left;">
<p>Login: <input type="text" name="user" value="', $user_info['username'], '"></p>
<p>Hasło: <input type="password" name="passwrd"></p>

<p><input type="checkbox" class="remember" id="remember"> <label for="remember">Zapamiętaj mnie</label></p>
<p><input type="submit" value="Zaloguj się" class="submit"></p>
</div>
<img src="images/secure.png" alt="" style="float: left;">
</form>'

Redirects me to board index.

funguy123us

Quote from: djmentos on June 26, 2010, 05:23:21 PM
When i try logout i get error with sessions verification failed caption)

I am getting the same error. Any ideas?

JBlaze

You may need to truncate your smf_sessions table, and make sure that subdomain independent cookies are enabled.
Jason Clemons
Former Team Member 2009 - 2012

funguy123us

I was able to fix this by unchecking following..

Use database driven sessions

thanks

JBlaze

Jason Clemons
Former Team Member 2009 - 2012

djmentos

Ok. It works, but from what I know sessions being kept in database are slightly more secure? Why SSI dosn't work with sessions form databases?

Secondly forwarding while loging in still dosn't work. After logging of its okey.

funguy123us

Quote from: djmentos on June 28, 2010, 04:55:17 AM
Ok. It works, but from what I know sessions being kept in database are slightly more secure? Why SSI dosn't work with sessions form databases?

Secondly forwarding while loging in still dosn't work. After logging of its okey.

I agree with you. What I did is just a workaround.

djmentos

I found a problem with redirect on login.
session_start() was on a top of PHP file.

Advertisement: