Services : Actualité Emploi Blog Forum Flux
Formation Trafic : Référencement Liens sponsorisés Affiliation Ecommerce Nom de domaine E-réputation Marketing Mobile Black Hat
Formation Technique : Performance Web Html Css Sql Curl Asp Dotnet Php Ajax Wordpress Twitter Google Analytics

Forum Oseox

Variable session en php et localhost (test local)

Forum Référencement et Trafic
Nous sommes le Sam 24 Fév 2018 11:18

Heures au format UTC [ Heure d’été ]

Poster un nouveau sujet Répondre au sujet
Auteur Message
MessagePosté: Mar 1 Sep 2009 22:30 

J'ai quelque soucis en php.

Mes variables sessions ne marchent pas en localhost

 Profil Envoyer un e-mail  
MessagePosté: Mar 1 Sep 2009 23:09 
Avatar de l’utilisateur
Si tu veux obtenir de l'aide il faudrait être plus précis dans ta demande.

As-tu lu la documentation PHP ou les cours sur Oseox : Session PHP avant ?
As-tu cherché sur Google si d'autres personnes ont eux le même problème en local host sur le même type de "serveur" que toi ?

 Profil Envoyer un e-mail  
MessagePosté: Mar 1 Sep 2009 23:23 
C'est suite à la lecture de la documentation PHP ou les cours sur Oseox que j'ai posté ma question. En fait si j'utilise la page sur mon serveur web les variables sessions sont visibles sur les pages mais si je teste les pages qui contiennent les variables sessions en local sur mon ordinateur ( en local host) j'ai un message d'erreur Undefined index . Est ce que cela n'est pas au niveau du php.ini. Voici mon php.ini :

; Handler used to store/retrieve data.
session.save_handler = files

; Argument passed to save_handler.  In the case of files, this is the path
; where data files are stored. Note: Windows users have to change this
; variable in order to use PHP's session functions.
; The path can be defined as:
;     session.save_path = "N;/path"
; where N is an integer.  Instead of storing all the session files in
; /path, what this will do is use subdirectories N-levels deep, and
; store the session data in those directories.  This is useful if you
; or your OS have problems with lots of files in one directory, and is
; a more efficient layout for servers that handle lots of sessions.
; NOTE 1: PHP will not create this directory structure automatically.
;         You can use the script in the ext/session dir for that purpose.
; NOTE 2: See the section on garbage collection below if you choose to
;         use subdirectories for session storage
; The file storage module creates files using mode 600 by default.
; You can change that by using
;     session.save_path = "N;MODE;/path"
; where MODE is the octal representation of the mode. Note that this
; does not overwrite the process's umask.
session.save_path = "c:/wamp/tmp"

; Whether to use cookies.
session.use_cookies = 1

;session.cookie_secure =

; This option forces PHP to fetch and use a cookie for storing and maintaining
; the session id. We encourage this operation as it's very helpful in combatting
; session hijacking when not specifying and managing your own session id. It is
; not the end all be all of session hijacking defense, but it's a good start.
session.use_only_cookies = 1

; Name of the session (used as cookie name).

; Initialize session on request startup.
session.auto_start = 0

; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0

; The path for which the cookie is valid.
session.cookie_path = /

; The domain for which the cookie is valid.
session.cookie_domain =

; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript.
session.cookie_httponly =

; Handler used to serialize data.  php is the standard serializer of PHP.
session.serialize_handler = php

; Defines the probability that the 'garbage collection' process is started
; on every session initialization. The probability is calculated by using
; gc_probability/gc_divisor. Where session.gc_probability is the numerator
; and gc_divisor is the denominator in the equation. Setting this value to 1
; when the session.gc_divisor value is 100 will give you approximately a 1% chance
; the gc will run on any give request.
; Default Value: 1
; Development Value: 1
; Production Value: 1
session.gc_probability = 1

; Defines the probability that the 'garbage collection' process is started on every
; session initialization. The probability is calculated by using the following equation:
; gc_probability/gc_divisor. Where session.gc_probability is the numerator and
; session.gc_divisor is the denominator in the equation. Setting this value to 1
; when the session.gc_divisor value is 100 will give you approximately a 1% chance
; the gc will run on any give request. Increasing this value to 1000 will give you
; a 0.1% chance the gc will run on any give request. For high volume production servers,
; this is a more efficient approach.
; Default Value: 100
; Development Value: 1000
; Production Value: 1000
session.gc_divisor = 1000

; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
session.gc_maxlifetime = 1440

; NOTE: If you are using the subdirectory option for storing session files
;       (see session.save_path above), then garbage collection does *not*
;       happen automatically.  You will need to do your own garbage
;       collection through a shell script, cron entry, or some other method.
;       For example, the following script would is the equivalent of
;       setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
;          cd /path/to/sessions; find -cmin +24 | xargs rm

; PHP 4.2 and less have an undocumented feature/bug that allows you to
; to initialize a session variable in the global scope, even when register_globals
; is disabled.  PHP 4.3 and later will warn you, if this feature is used.
; You can disable the feature and the warning separately. At this time,
; the warning is only displayed, if bug_compat_42 is enabled. This feature
; introduces some serious security problems if not handled correctly. It's
; recommended that you do not use this feature on production servers. But you
; should enable this on development servers and enable the warning as well. If you
; do not enable the feature on development servers, you won't be warned when it's
; used and debugging errors caused by this can be difficult to track down.
; Default Value: On
; Development Value: On
; Production Value: Off
session.bug_compat_42 = On

; This setting controls whether or not you are warned by PHP when initializing a
; session value into the global space. session.bug_compat_42 must be enabled before
; these warnings can be issued by PHP. See the directive above for more information.
; Default Value: On
; Development Value: On
; Production Value: Off
session.bug_compat_warn = On

; Check HTTP Referer to invalidate externally stored URLs containing ids.
; HTTP_REFERER has to contain this substring for the session to be
; considered as valid.
session.referer_check =

; How many bytes to read from the file.
session.entropy_length = 0

; Specified here to create the session id.
;session.entropy_file = /dev/urandom
session.entropy_file =

;session.entropy_length = 16

; Set to {nocache,private,public,} to determine HTTP caching aspects
; or leave this empty to avoid sending anti-caching headers.
session.cache_limiter = nocache

; Document expires after n minutes.
session.cache_expire = 180

; trans sid support is disabled by default.
; Use of trans sid may risk your users security.
; Use this option with caution.
; - User may send URL contains active session ID
;   to other person via. email/irc/etc.
; - URL that contains active session ID may be stored
;   in publically accessible computer.
; - User may access your site with the same session ID
;   always using URL stored in browser's history or bookmarks.
session.use_trans_sid = 0

; Select a hash function for use in generating session ids.
; Possible Values
;   0  (MD5 128 bits)
;   1  (SHA-1 160 bits)
session.hash_function = 0

; Define how many bits are stored in each character when converting
; the binary hash data to something readable.
; Possible values:
;   4  (4 bits: 0-9, a-f)
;   5  (5 bits: 0-9, a-v)
;   6  (6 bits: 0-9, a-z, A-Z, "-", ",")
; Default Value: 4
; Development Value: 5
; Production Value: 5
session.hash_bits_per_character = 5

; The URL rewriter will look for URLs in a defined set of HTML tags.
; form/fieldset are special; if you include them here, the rewriter will
; add a hidden <input> field with the info which is otherwise appended
; to URLs.  If you want XHTML conformity, remove the form entry.
; Note that all valid entries require a "=", even if no value follows.
; Default Value: "a=href,area=href,frame=src,form=,fieldset="
; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry"
; Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry"
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"

; Allow or prevent persistent links.
mssql.allow_persistent = On

; Maximum number of persistent links.  -1 means no limit.
mssql.max_persistent = -1

; Maximum number of links (persistent+non persistent).  -1 means no limit.
mssql.max_links = -1

; Minimum error severity to display.
mssql.min_error_severity = 10

; Minimum message severity to display.
mssql.min_message_severity = 10

; Compatibility mode with old versions of PHP 3.0.
mssql.compatability_mode = Off

; Connect timeout
;mssql.connect_timeout = 5

; Query timeout
;mssql.timeout = 60

; Valid range 0 - 2147483647.  Default = 4096.
;mssql.textlimit = 4096

; Valid range 0 - 2147483647.  Default = 4096.
;mssql.textsize = 4096

; Limits the number of records in each batch.  0 = all records in one batch.
;mssql.batchsize = 0

; Specify how datetime and datetim4 columns are returned
; On => Returns data converted to SQL server settings
; Off => Returns values as YYYY-MM-DD hh:mm:ss
;mssql.datetimeconvert = On

; Use NT authentication when connecting to the server
mssql.secure_connection = Off

; Specify max number of processes. -1 = library default
; msdlib defaults to 25
; FreeTDS defaults to 4096
;mssql.max_procs = -1

; Specify client character set.
; If empty or not set the client charset from freetds.comf is used
; This is only used when compiled with FreeTDS
;mssql.charset = "ISO-8859-1"

; Assert(expr); active by default.
; = On

; Issue a PHP warning for each failed assertion.
;assert.warning = On

; Don't bail out by default.
;assert.bail = Off

; User-function to be called if an assertion fails.
;assert.callback = 0

; Eval the expression with current error_reporting().  Set to true if you want
; error_reporting(0) around the eval().
;assert.quiet_eval = 0

; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs
;com.typelib_file =

; allow Distributed-COM calls
;com.allow_dcom = true

; autoregister constants of a components typlib on com_load()
;com.autoregister_typelib = true

; register constants casesensitive
;com.autoregister_casesensitive = false

; show warnings on duplicate constant registrations
;com.autoregister_verbose = true

; The default character set code-page to use when passing strings to and from COM objects.
; Default: system ANSI code page

; language for internal character representation.
;mbstring.language = Japanese

; internal/script encoding.
; Some encoding cannot work as internal encoding.
; (e.g. SJIS, BIG5, ISO-2022-*)
;mbstring.internal_encoding = EUC-JP

; http input encoding.
;mbstring.http_input = auto

; http output encoding. mb_output_handler must be
; registered as output buffer to function
;mbstring.http_output = SJIS

; enable automatic encoding translation according to
; mbstring.internal_encoding setting. Input chars are
; converted to internal encoding by setting this to On.
; Note: Do _not_ use automatic encoding translation for
;       portable libs/applications.
;mbstring.encoding_translation = Off

; automatic encoding detection order.
; auto means
;mbstring.detect_order = auto

; substitute_character used when character cannot be converted
; one from another
;mbstring.substitute_character = none;

; overload(replace) single byte functions by mbstring functions.
; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(),
; etc. Possible values are 0,1,2,4 or combination of them.
; For example, 7 for overload everything.
; 0: No overload
; 1: Overload mail() function
; 2: Overload str*() functions
; 4: Overload ereg*() functions
;mbstring.func_overload = 0

; enable strict encoding detection.
;mbstring.strict_detection = Off

; This directive specifies the regex pattern of content types for which mb_output_handler()
; is activated.
; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml)

; Allows to set script encoding. Only affects if PHP is compiled with --enable-zend-multibyte
; Default: ""

; Tell the jpeg decode to ignore warnings and try to create
; a gd image. The warning will then be displayed as notices
; disabled by default
;gd.jpeg_ignore_warning = 0

; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS.
; With mbstring support this will automatically be converted into the encoding
; given by corresponding encode setting. When empty mbstring.internal_encoding
; is used. For the decode settings you can distinguish between motorola and
; intel byte order. A decode setting cannot be empty.
;exif.encode_unicode = ISO-8859-15

;exif.decode_unicode_motorola = UCS-2BE

;exif.decode_unicode_intel    = UCS-2LE

;exif.encode_jis =

;exif.decode_jis_motorola = JIS

;exif.decode_jis_intel    = JIS

; The path to a default tidy configuration file to use when using tidy
;tidy.default_config = /usr/local/lib/php/default.tcfg

; Should tidy clean and repair output automatically?
; WARNING: Do not use this option if you are generating non-html content
; such as dynamic images
tidy.clean_output = Off

; Enables or disables WSDL caching feature.

; Sets the directory name where SOAP extension will put cache files.

; (time to live) Sets the number of second while cached file will be used
; instead of original one.

; Sets the size of the cache limit. (Max. number of WSDL files to cache)
soap.wsdl_cache_limit = 5

; A default size of the shared memory segment
;sysvshm.init_mem = 10000

; Sets the maximum number of open links or -1 for unlimited.
ldap.max_links = -1

; For more information about mcrypt settings see

; Directory where to load mcrypt algorithms
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)

; Directory where to load mcrypt modes
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)


; Local Variables:
; tab-width: 4
; End:

 Profil Envoyer un e-mail  
MessagePosté: Mar 1 Sep 2009 23:46 

C'est plutot le code php qui te permet de dire que les sessions ne marchent pas qui serait intéressant.
Tu peux nous poster un exemple, stp ?


 Profil Envoyer un e-mail  
MessagePosté: Jeu 10 Sep 2009 18:43 
Salu à tous . Je tiens à informer le forum de la solution trouvée au sujet d'une erreur sur les variables sessions qui ne fonctionnent pas en local host. En effet c'été à cause de la codification de php.
* codification qui génère l'erreur . les varables sessions ne sont pas visible en localhost
<? <--
// Démarrage ou restauration de la session
* Bonne codification : les varables sessions sont visible en localhost
<?php <--
// Démarrage ou restauration de la session

 Profil Envoyer un e-mail  
MessagePosté: Ven 11 Sep 2009 09:59 
Avatar de l’utilisateur
J'ai de sérieux doutes sur le fait que ton PHP s'exécutait (pas uniquement ta session). Par défaut à l'installation de PHP, le tag d'ouverture "<?" ne fonctionne pas effectivement.
Par contre, il n'y a pas de raison pour ta session ne fonctionne pas en localhost, à moins que tu ais désactivé la fonction explicitement.

 Profil Envoyer un e-mail  
MessagePosté: Ven 11 Sep 2009 10:31 
Ci-dessus j'avais posté mon php.ini (la partie session) vous pouvez le consulter svp pour se rassurer que c'est un pb de tag d'ouverture <?.

 Profil Envoyer un e-mail  
MessagePosté: Ven 11 Sep 2009 11:39 
Avatar de l’utilisateur
Si short_open_tag est à off tu ne peux pas utiliser la syntaxe <? si c'est à On tu peux. :)

Dans tous les cas, il est conseillé d'utiliser <?php pour des questions de portabilité.

 Profil Envoyer un e-mail  
Afficher les messages postés depuis:  Trier par  
Poster un nouveau sujet Répondre au sujet  [ 8 messages ] 

Heures au format UTC [ Heure d’été ]

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 1 invité

Vous ne pouvez pas poster de nouveaux sujets
Vous ne pouvez pas répondre aux sujets
Vous ne pouvez pas éditer vos messages
Vous ne pouvez pas supprimer vos messages
Vous ne pouvez pas joindre des fichiers

Aller à:  
Abonnez-vous au flux RSS



Offres d'emploi

Copyright : Moteur, traduction et optimisation
Merci de votre visite sur le forum Oseox