<? session_start(); //starter session session_register("sessionvariabel"); //registrere en variabel til session $sessionvariabel = "Dette er værdien af min registrede sessionvariabel"; ?>
fil2.php
<? session_start(); echo $sessionvariabel; ?>
Fil1.php opretter en sesion - son den skal og indsætter de data der skal.
Fil2.php - opretter blot en ny session som er tom - læser ikke den session sat i fil1.php
[Session] ; Handler used to store/retrieve data. session.save_handler = files
session.save_path = d:/sessions
; 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.
; Whether to use cookies. session.use_cookies = 1
; Name of the session (used as cookie name). session.name = PHPSESSID
; 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 = d:/sessions
; The domain for which the cookie is valid. session.cookie_domain =
; Handler used to serialize data. php is the standard serializer of PHP. session.serialize_handler = php
; Percentual probability that the 'garbage collection' process is started ; on every session initialization. session.gc_probability = 1
; After this number of seconds, stored data will be seen as 'garbage' and ; cleaned up by the garbage collection process. session.gc_maxlifetime = 1440
fandt selv fejlen session.use_trans_sid = 1 skal være 0
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.