Jump to content

[SOLVED] Why do I keep getting logged out of CMS?


goodrichdesigns

Recommended Posts

I have a PHP calendar set up that functions using a CMS back-end system. I've installed it however I'm having problems with the login.

 

Quite often, after I have already logged in, I will go to do something e.g. edit an existing event, and it will suddenly ask me for my login again and then I have to start over.

 

Does any have any idea why this could be?

 

I'm fairly new to PHP so apologies if I'm being noobish!

Link to comment
Share on other sites

Not exactly that though it does contain settings for creating a session. I'm afraid my knowledge of sessions and cookies via PHP is relatively poor.

 

I have attached the page which is the main admin page. If you could have a quick look at it that'd be awesome.

 

Thank you for your help :)

 

[attachment deleted by admin]

Link to comment
Share on other sites

Your Sessions are being wiped

 

please note the code below

 

Line 10+

if(!is_writable(session_save_path()))session_save_path("/tmp");
session_start();
ob_start();
$__SESSION__=$HTTP_SESSION_VARS['__SESSION__'];
foreach($HTTP_POST_VARS as $k=>$v){
if(!is_array($v))${urldecode($k)}=urldecode($v);
}

 

Line: 82+

$page or $page = 'e';
if($page =="l"){
$HTTP_SESSION_VARS = array(); //This line will cause the problem
header("Location: index.php");
exit;
}

 

 

 

 

EDIT:

maybe try setting the Session to a var then setting them back after the call

ie

<?php
session_start();
$tmpSession = $_SESSION;
include "calander_admin_file.php";
$_SESSION = $tmpSession;
?>

Link to comment
Share on other sites

i have created a revised version it may work..

 

it used the basic idea of the above code but takes into account the headers locations.

 

 

of couse an include could also mess it up!

 

backup your current file and remove the 2 from this file

 

[attachment deleted by admin]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.