Welcome! Log In Create A New Profile

Advanced

Loggedin_SESSIONS

Posted by 39150720 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Loggedin_SESSIONS
October 24, 2012 11:42AM
Hi Mac

i have utilized SESSIONS_LoggedIn extensive on my application, i noticed on the free hosting site these sessions at times it times-out because of connection to mysql,
i have used the SESSIONS to validate loggins before any update, listing, insert and delete, this works well on my local machine because the connection is stable.
i can remove sessions but this will mean that registrations and login becomes useless because the pages can be access directly and update can be made if they are not defined.


my question are:
1. Will i be penalised for having SESSIONS timing out because of the free hosting site?.
2. i have already submitted my portfolio and i noticed that the only irritation is having to log-in again because of sessions that are logged-out at times because of the connection, do i need to change this approach to suite Free-hosting Site?


E.G.
LIST
<?
include "connect.php";
if(!empty($_SESSION['LoggedIn'])){
$strSQL = "SELECT * FROM admins";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"winking smiley;?>


E.G
DELETE

<?php
include "connect.php";

if(isset($_GET['id']) && !empty($_SESSION['LoggedIn'])){
$id = $_GET['id'];
$result = mysql_query("DELETE FROM admins WHERE id=$id"winking smiley;
if($result !== false) {
header("Location: deletesuccess.php"winking smiley;
}
}else {
header("Location: deletefail.php"winking smiley;

}
?>
avatar
Mac
Re: Loggedin_SESSIONS
October 24, 2012 02:41PM
1. No, but it is strange because I have not come across this before. I cannot imagine that they will limit a session to a minute or two.
2. Add code that prints out a message if the session has expired, or increase the session timeout code side. http://www.daniweb.com/web-development/php/threads/124500/session-time-out-in-php
Re: Loggedin_SESSIONS
October 24, 2012 03:16PM
Hi Mac,

thanks for the response,

i already have an alert on my blocks of code, which also redirect the user to the login page.
i was just a bit worried about timeouts which were beyond my control.


E.G
LISTFILTER

<?php
include "connect.php";
if(!empty($_SESSION['LoggedIn'])){

mysql_select_db("mydb", $con);

$result = mysql_query("SELECT * FROM admins WHERE Name = '{$_POST["grup"]}'"winking smiley;?>


**************HTML CODE*********************
}
else{
header("Location: accessfirstalert.php"winking smiley;
}?>
Sorry, only registered users may post in this forum.

Click here to login