Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

.NET Forum


You are currently viewing our .NET Forum as a guest. Please register to participate.
Login



Reply
expire the session in vbscript : .NET
Old 07-04-2008, 02:06 PM expire the session in vbscript : .NET
Nazi370's Avatar
Skilled Talker

Posts: 70
Name: Nazirul
Trades: 0
Hi ! ...

how do i expire the session created whilst in login? i have google some page but no luck...

this code :

Quote:
If ValidUser.Read() Then
Session("UserType") = "Student"
Session("FullName") = ValidUser.Item("FullName")
Session("MatricNo") = ValidUser.Item("MatricNo")
Session("Course") = ValidUser.Item("Course")
Response.Redirect("Mainpage.aspx")
Else
lblMsg.Text = "Invalid Password/Credential"
lblMsg.Visible = True
End If

thanks...
Nazi370 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-05-2008, 05:46 AM Re: expire the session in vbscript : .NET
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,522
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
In no particular order

1/ set them to empty strings.
2/ use session.abandon
3/ use session.contents.removeall()

Take your pick.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-06-2008, 02:48 AM Re: expire the session in vbscript : .NET
Nazi370's Avatar
Skilled Talker

Posts: 70
Name: Nazirul
Trades: 0
Quote:
1/ set them to empty strings.
Do you mean like : Session("UserType") = "I_am_logoff"

it does not work.. maybe 2 or 3... i will try it..
thanks chris
Nazi370 is offline
Reply With Quote
View Public Profile
 
Old 07-06-2008, 04:53 AM Re: expire the session in vbscript : .NET
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,522
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
empty means empty, ie zero length

= ""
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-08-2008, 12:40 AM Re: expire the session in vbscript : .NET
Nazi370's Avatar
Skilled Talker

Posts: 70
Name: Nazirul
Trades: 0
sory christ.. it actuall work

expire : Session("UserType") = ""
not expired : Session("UserType") = "I_am_logoff"

do any one know why even i've changed the session type, it still can access the web page? but no when set to empty string?

thanks..
Nazi370 is offline
Reply With Quote
View Public Profile
 
Old 07-08-2008, 03:29 AM Re: expire the session in vbscript : .NET
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,522
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
No idea, It's your code so we have no idea how it works.


do you check for a value or just the session key/value existing?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-10-2008, 04:34 AM Re: expire the session in vbscript : .NET
Nazi370's Avatar
Skilled Talker

Posts: 70
Name: Nazirul
Trades: 0
If Trim(Session("StaffType")) = "" Then
Response.Redirect("Invalid.aspx")
End If

If Not Page.IsPostBack Then

End If


this is on page_load ...

it work since when i set the session to "" , then on the page_load will identify it and prohibit to enter the page...

thanks chris
Nazi370 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to expire the session in vbscript : .NET
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.22978 seconds with 12 queries