webForumDet fria alternativet

session

6 svar · 279 visningar · startad av Php

PhpMedlem sedan sep. 2001225 inlägg
#1

Hej jag använder session till min röst script men jag får det inte att fungera. Jag får detta felmedelande:
Warning: open(/tmp\sess_f24e235828d444ca3812487aab24f590, O_RDWR) failed: m (2) in Unknown on line 0

Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0

juventus1Medlem sedan dec. 2000401 inlägg
#2

Lite mer kod skulle underlätta. Men är inte den ena slashen åt fel håll?

open(/tmp[b]/[/b]sess_f24e235828d444ca3812487aab24f590, O_RDWR)
SPiNMedlem sedan mars 20005 832 inlägg
#3

Du kanske inte har skrivrättigheter i session-katalogen, eller så har du inte angivit en korrekt path till en katalog där sessionerna ska sparas ( php.ini under [sessions] )?

PhpMedlem sedan sep. 2001225 inlägg
#4

Jag ändra raden session.save_path i php.ini till \windows/Temp så nu får jag inte det felmedelandet längre utan nu får jag detta:
Warning: Cannot send session cookie - headers already sent by (output started at

Här är hela session delen i php.ini:

[Session]
session.save_handler = files ; handler used to store/retrieve data
session.save_path = \windows/Temp ; argument passed to save_handler
; in the case of files, this is the
; path where data files are stored
session.use_cookies = 1 ; whether to use cookies
session.name = PHPSESSID
; name of the session
; is used as cookie name
session.auto_start = 0 ; initialize session on request startup
session.cookie_lifetime = 0 ; lifetime in seconds of cookie
; or if 0, until browser is restarted
session.cookie_path = / ; the path the cookie is valid for
session.cookie_domain = localhost ; the domain the cookie is valid for
session.serialize_handler = php ; handler used to serialize data
; php is the standard serializer of PHP
session.gc_probability = 1 ; percentual probability that the
; 'garbage collection' process is started
; on every session initialization
session.gc_maxlifetime = 1440 ; after this number of seconds, stored
; data will be seen as 'garbage' and
; cleaned up by the gc process
session.referer_check = ; check HTTP Referer to invalidate
; externally stored URLs containing ids
session.entropy_length = 0 ; how many bytes to read from the file
session.entropy_file = ; specified here to create the session id
; session.entropy_length = 16
; session.entropy_file = /dev/urandom
session.cache_limiter = nocache ; set to {nocache,private,public} to
; determine HTTP caching aspects
session.cache_expire = 180 ; document expires after n minutes
session.use_trans_sid = 1 ; use transient sid support if enabled
; by compiling with --enable-trans-sid
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"

PhpMedlem sedan sep. 2001225 inlägg
#5

Jag har fixat nu så att jag inte får nåt felmedelande men sessionen verkar inte fungera för man kan rösta hur många gånger som helst den skapar en session i temp mapen.
Jag skulle tro att det är nåt fel i php.ini för när jag testar detta på ett webhotel så fungerar det.

JonttoMedlem sedan okt. 2001126 inlägg
#6

Är ingen xpert, men får man inte det meddelandet om man försöker spara en session/cookie efter att har sänt information till browsern?

JonttoMedlem sedan okt. 2001126 inlägg
#7

*läste lite slarvigt...*

Nojaa, du överlever väl fast jag lite klanttar till det

128 ms totalt · 3 externa anrop · cache AV · v20260731051352-full.56cc9887
0 ms — hämta statistik (cache)
0 ms — hämta forumlista (cache)
125 ms — hämta tråd, inlägg och bilagor (db)