SOLVED: Logout w/ SSI.php

Started by PsuFan, August 10, 2009, 01:18:07 PM

Previous topic - Next topic

PsuFan

I cant figure out why SSI.php can determine if Im logged in or not, but when I try to logout with $context['session_var'] & $context['session_id'], they are different values and fails the session verification...

forums/?action=logout;" . $context['session_var'] . '=' . $context['session_id']

Thanks

Arantor

In that script where you're calling that, was SSI.php already included? If so you could use ssi_logout to generate the link for you.
Holder of controversial views, all of which my own.


H

You can also use the Logout function from the SMF source files directly. You can take a look at this from the Function DB when it is working again
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

PsuFan

Session verification failed. Please try logging out and back in again, and then try again.

That did the same thing, and the function db isnt working. It uses the same thing that I was, it gives different numbers...

$context['session_var'] . '=' . $context['session_id']

Arantor

So, ssi_logout gives you different numbers but still fails? Weird.
Holder of controversial views, all of which my own.


PsuFan

It fails because it gives different numbers... but yes. Anyone know why this is happening? Is this a bug? I dont understand how the cookie is working because its in the same domain & it says im logged in but has pulls different session ids.

PsuFan

#6
I cant figure it out....

if (!isset($_SESSION['session_var']))

The session var is blank causing it to be created twice in both places ("/" and "/forums")

E: I found it > Use database driven sessions

Can anyone explain what this is doing now? The session information is being stored in a /tmp folder or something on the server instead of the smf database?

Arantor

Is it ticked or unticked now?

That check shouldn't fail if put after SSI.php.
Holder of controversial views, all of which my own.


PsuFan

Unchecked solved the problem, what does that change?

Arantor

That means sessions are not being stored in the database, but in a file in /tmp.
Holder of controversial views, all of which my own.


PsuFan

Thats what I thought, thanks a lot!

ninjacowpizza

#11
I had a similar problem.  My $context session id on my web site was different from the session id on my forum pages, giving me session authentication errors on logout. 

While experiencing this error my server settings were:
Enable Local Storage of Cookies = unchecked
Enable Subdomain Independent Cookies = checked
Use database driven sessions = unchecked

To solve the problem I enabled local storage of cookies, cleared my browsers cache and logged in again and now my session ids match up. It seems like a strange solution though because underneath Enable Subdomain Independent Cookies it says to turn off local cookies first. ???


Edit: I was able to get it working without enabling local storage of cookies.

Follow this thread: http://www.simplemachines.org/community/index.php?topic=321428.0

Advertisement: