Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Community > Forum De Bell Tolls > [ASP] Session_OnEnd()
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
superfabius
.grande:maestro.

User info:
Registered: Nov 2002
Posts: 1519 (0.18 al dì)
Location:
Corso:
Anno:
Time Online: 37 Days, 15:58:19 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
[ASP] Session_OnEnd()

Session OnEnd() global.asa
Che voi sappiate è possibile scrivere un cosa del genere nel global.asa?

sub session_onend()

Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("db.mdb")
stato = "DELETE * FROM login WHERE nick='"&request.cookies ("nomecookie")("nick")&"'"

Set rss = Server.CreateObject("ADODB.Recordset")
rss.Open stato, conn, 3, 3
end sub

In pratica devo cancellare da un db un utente quando questo lascia il sito. Se la procedura sopra nn si puo' fare(come mi sembra) avete suggerimenti?
Altra cosa.....la session onend inizia quando l'utente chiude il browser oppure dopo qualche minuto?
Inoltre per richiamare la procedura sopra devo scrivere session.abandon nella pagina in cui la voglio richiamare?

08-02-2004 13:35
Click Here to See the Profile for superfabius Click here to Send superfabius a Private Message Find more posts by superfabius Add superfabius to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ripe
- up in the mountains -

User info:
Registered: Jun 2002
Posts: 9469 (1.10 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Tutte e due, sia quando viene chiusa la finestra del browser, sia dopo un tempo di timeout che di default è fissato a 20 minuti (ma che puoi tranquillamente modificare con Session.Timeout). Sesson.Abandon puoi usarlo per forzare il termine di una sessione.

Puoi usare tranquillamente Session_OnEnd per eseguire delle azioni quando scade la sessione. Inserisci la tua procedura in global.asa e tutto dovrebbe funzionare come vuoi tu!

;)

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»

08-02-2004 15:13
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
superfabius
.grande:maestro.

User info:
Registered: Nov 2002
Posts: 1519 (0.18 al dì)
Location:
Corso:
Anno:
Time Online: 37 Days, 15:58:19 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ok
e dopo non devo richiamarla quindi nella pagina asp in cui voglio che accada quello che ho scritto nel global.asa giusto?

08-02-2004 15:16
Click Here to See the Profile for superfabius Click here to Send superfabius a Private Message Find more posts by superfabius Add superfabius to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ripe
- up in the mountains -

User info:
Registered: Jun 2002
Posts: 9469 (1.10 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Quello che hai scritto nel global.asa vale per tutto l'insieme delle tue pagine... basta che sia inserito nella root e dovrebbe funzionare correttamente.

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»

08-02-2004 15:19
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
superfabius
.grande:maestro.

User info:
Registered: Nov 2002
Posts: 1519 (0.18 al dì)
Location:
Corso:
Anno:
Time Online: 37 Days, 15:58:19 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

thanx
dopo provo

08-02-2004 15:20
Click Here to See the Profile for superfabius Click here to Send superfabius a Private Message Find more posts by superfabius Add superfabius to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
superfabius
.grande:maestro.

User info:
Registered: Nov 2002
Posts: 1519 (0.18 al dì)
Location:
Corso:
Anno:
Time Online: 37 Days, 15:58:19 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

nn si puo' mettere quel codice nel global.asa
cmq devo realizare una procedura che cancella da un db un nome di un utente quando questo chiude il browser
suggerimenti?

08-02-2004 20:58
Click Here to See the Profile for superfabius Click here to Send superfabius a Private Message Find more posts by superfabius Add superfabius to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
URANIO
.utente.radioattivo

User info:
Registered: Nov 2001
Posts: 1011 (0.11 al dì)
Location: Casalpusterlengo (LO)
Corso: TICo
Anno:
Time Online: 11 Days, 6:12:08: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

L'unico modo per identificare con certezza se un utente è ancora presente o no è usare il global.asa

...ma sei sicuro che non si possa mettere quel codice?

__________________
BinarySun
"L'intelligenza è una pianta che va curata continuamente.
Dovreste vedere com'è bello, il mio bonsai."
Rat-man®

09-02-2004 10:57
Click Here to See the Profile for URANIO Click here to Send URANIO a Private Message Find more posts by URANIO Add URANIO to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
superfabius
.grande:maestro.

User info:
Registered: Nov 2002
Posts: 1519 (0.18 al dì)
Location:
Corso:
Anno:
Time Online: 37 Days, 15:58:19 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

si.....o almeno mi hanno detto che ne l global asa non posso usare il server mappath
cmq anche se non uso quel codice nn mi offendo :D
nn c'e' nessuno che magari ha già provato a fare una cosa del genere in asp e mi dice come ha fatto?thnx

09-02-2004 11:06
Click Here to See the Profile for superfabius Click here to Send superfabius a Private Message Find more posts by superfabius Add superfabius to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
URANIO
.utente.radioattivo

User info:
Registered: Nov 2001
Posts: 1011 (0.11 al dì)
Location: Casalpusterlengo (LO)
Corso: TICo
Anno:
Time Online: 11 Days, 6:12:08: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Be se il problema è solo il mappath basta che gli metti il percorso diretto...

__________________
BinarySun
"L'intelligenza è una pianta che va curata continuamente.
Dovreste vedere com'è bello, il mio bonsai."
Rat-man®

09-02-2004 11:24
Click Here to See the Profile for URANIO Click here to Send URANIO a Private Message Find more posts by URANIO Add URANIO to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
superfabius
.grande:maestro.

User info:
Registered: Nov 2002
Posts: 1519 (0.18 al dì)
Location:
Corso:
Anno:
Time Online: 37 Days, 15:58:19 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

mettiamo che il db sia su
http://www.db.it/db.mdb
cos ci scrivo se non uso server mappath?
mi scrivi la riga di codice?

09-02-2004 11:27
Click Here to See the Profile for superfabius Click here to Send superfabius a Private Message Find more posts by superfabius Add superfabius to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 00:20.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.106 seconds (48.74% PHP - 51.26% MySQL) con 25 query.