Forum Moderators: coopster
i have a skinngin script that doesnt work in explorer, i believe because of cookie support.
setskin script:
<?php
session_start();
//get $art
//check if 'art' is set
if(!isset($_GET['art']))
{
$art = 'index.txt';
}
else{
$art = $_GET['art'];
}
//check if 'skin' is set
if(!isset($_GET['skin']))
{
$skin = 'flyaway_yellow3.css';
}
else{
$skin = $_GET['skin'];
}
// Register session key with the value
$_SESSION['skin'] = $skin;
header("Location: index.php?art=$art")
?>
get skin:
<?php
session_start();
//session code for skins
//header('Cache-control: private'); //IE 6 Fix
if ( isset($_SESSION['skin']) ) {
$skin = $_SESSION['skin'];
}
else {
$skin = "flyaway_yellow3.css";
}
//end session code
//start art code for main content
if(isset($_GET['art']))
{
if ($_GET['art']=='index.php')
{
$art='index.txt';
}
else
{
$art= $_GET['art'];
}
}
else{
$art='index.txt';
}
session.use_cookies
session.use_cookies specifies whether the module will use cookies to store the session id on the client side. Defaults to 1 (enabled).
session.use_only_cookies
session.use_only_cookies specifies whether the module will only use cookies to store the session id on the client side. Defaults to 0 (disabled, for backward compatibility). Enabling this setting prevents attacks involved passing session ids in URLs. This setting was added in PHP 4.3.0.
With defaults PHP will handle this automatically. If it can't set a cookie then it will use the session id in the url.
If you can't get to your php.ini file, you can set either of these which Timotheos suggests with ini_set() at the top of your scripts;
ini_set('session.use_cookies', 0); to turn on url-based sessions. However, this can affect your search engine friendliness. Maybe you can conditionally start the session - if(!empty($_GET['PHPSESID'])){ session_start(); if(isset .... etc.
}
and block access to your skin switcher with robots.txt.
Php session id's in the url's won't be your only problem with search engine friendliness, though - it's likely that you will have some negative effects in your rankings from the fact that you use a frame to insert all content from another domain. If you want your site to do well in the search engines, I'd really try to find another domain where you don't have to do this. I do believe the .net and .org for your domain name are free, and you should be able to get one of these from a decent registrar for less than $10 a year. This will save you a lot of grief when it comes to trying to promote your site, and it might solve your cookies - in - ie problem. Getting people to visit your site when you begin can be a pain and the SE's can really help you.
kumar