cookie error
Collapse
X
-
i found a solution seems when sessions expire after the 30min period there classed as expired meaning there no longer isset so i made this function you's can run it thru addonline()
to change the expire time jus edit strtotime("+1 year")PHP Code:function UpdateCookie()
{
if (isset($_COOKIE['session_id'])) setcookie("session_id",$_COOKIE['session_id'],strtotime("+1 year"),"/");
}
Leave a comment:
-
i havnt tested the other ie versions few other forums had problems relating to ie7 and up even a few on firefox am gonna try something different wif my guest sessions
Leave a comment:
-
guess its not practical for that but it would solve your problem
i guess the only real use for it is to stop flooders lol
maybe you will have to change your links for ie8
Leave a comment:
-
in that case cant you use a second page to set the cookie with a header redirecting to current page? ........ i use this way to stop people from people pushing back and reposting ..... so i dont have to restrict caching of pages making load time quicker*
Leave a comment:
-
i no... its obvious whats happening but how 2 have the msg only when cookie cant be stored
Leave a comment:
-
its pretty straight forward, the first time this script is called the line above will set the cookie and also echo that message. The next time u reload or visit the page it wnt show up because it was set previously.Originally posted by ori View Postive been making a code 2 use cookies for my mobile script i put in a code 2 give a error if cookie cant be stored for older mobiles or ppl that turn cookies off but ppl are getting the error then when they reload it comes up wif the site any suggestions 2 fix this
the code im using is
PHP Code:<?php
if (!isset($_COOKIE['session_id'])) die("You must enable cookies to use this site"); // this is where the problem lies
Leave a comment:
-
ive made the site so it always uses act=index lol the glitch is jus its showing the error when cookie is stored
Leave a comment:
-
i think its when ppl type site.com/?act=index if they type jus site.com then they dnt get the no cookie error
Leave a comment:
-
debug it:
print_r($_COOKIE);
may need to use:
setcookie("session_id","test");
Leave a comment:
-
cookie error
ive been making a code 2 use cookies for my mobile script i put in a code 2 give a error if cookie cant be stored for older mobiles or ppl that turn cookies off but ppl are getting the error then when they reload it comes up wif the site any suggestions 2 fix this
the code im using is
PHP Code:<?php
define('DRK',true);
putenv("TZ=Australia/Sydney");
session_name("session_id");
session_start();
$act = get_var("act");
$mode = get_var("mode");
if ($act == "index") unset($_SESSION['uid']);
if (!isset($_SESSION['username'])) $_SESSION['username'] = "Guest";
if (!isset($_SESSION['ses'])) $_SESSION['ses'] = "Guest_".substr(md5(time()),0,12);
if (empty($act)) header("Location: http://$_SERVER[SERVER_NAME]/?act=index");
if (!isset($_COOKIE['session_id'])) die("You must enable cookies to use this site"); // this is where the problem liesTags: None
Leave a comment: