|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
hi....this is thee first time that i'm posting my problem here. my problem is that i want to use sessions in asp.net using vb.net.... the scenario is that i want a user to sign in while viewing specific pages. these pages are user specific and they require the user to first sign in or logon at the site. e.g if a user has posted a product fore online bidding, and now he wants to edit his posted offer, then the pages that show his post must require his sign in before he can do any editing. same if the session expires then the user must be redirected to the sign in page. i worked on it a lot......and the problem that i encountered was that a session is started when user views a page and it ends or it is restarted when i redirect the user to another page. even the session id is changed for evry other page...and if i refresh the page session id also changes. i made the logic that i declared session("id")="start" in global.asax file. and then in the sign in page i changed this value to be session("id")=request.form("User_Id"). now according to my logic, it should remain the same until the sessions ends. so that with every new page, the page should check this session("id") variable, if it is empty then the user must b redirected to the sign in page but if it contains the user id that he entered in the User_Id text box then the page should display the information specific to that user. but it doesnt work....if any body knows the solution to this problem then please reply me or mail me....i'm waiting.... |
|
#2
|
|||
|
|||
|
Is your sessionstate enabled in your web.config file?
__________________
- Rogier Doekes |
|
#3
|
|||
|
|||
|
Also are all the pages in the same project?
|
|
#4
|
|||
|
|||
|
Quote:
yes, all the pages are included in a single project. every time the user closes a page or refresh a page, a new session is started and the session id is changed. if the session id could remain same when the user visits different pages in the same application, then it can solve my problem. but session id doesnt remains same. i have read in books n everywhere that a session ends when user leaves the application, but when i tried it, i experienced that a session ends when a user closes a page or refreshes it. if u know the problem to my solution then plz reply me as soon as possible. thnx |
|
#5
|
|||
|
|||
|
Try adding the following entry
<sessionState mode="InProc" cookieless="false" timeout="20" /> in web.config file.... Maybe ur cookieless is set to true which means a new session id will be created for each (relative) page u open to keep its internal tracking.... Hope it works.. All the best |
|
#6
|
|||
|
|||
|
Instead of session("id")="start" try using Session.Add("id", "start")
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > .NET Development > i am having problems in managing sessions in asp.net using vb.net |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|