Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Session Variables
Message
From
02/10/2003 13:01:45
 
 
To
02/10/2003 12:16:17
Jacci Adams
Lindsay-Adams Consulting
Louisville, Ohio, United States
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00834235
Message ID:
00834348
Views:
22
If I couldn't use cookies at all... I think what I would do is generate a random key when the first application starts up. Then use a table with a place for my random key field plus a field for each piece of data I need to store for the user's session. Use the random key to identify the user and then pass it along between the pages. In the initial page processing I would call a routine that uses the key to locate the user record and load the fields into variables. You would need some sort of maintenace routine to keep the table to a resonable size or to 'timeout' users after a specific period of time. I would probably build the key to embed a timeout value in the key. Then in the session lookup I would first look to see if the key is still valid based on the timeout value (probably a date/time serial) embedded in the key. If it is not valid (the current time exceeds the date/time embedded in the key) then you don't have to do anything because you want it to be like the user has just shown up for the first time.

You could probably build it as a hybrid where it first checks if cookies are turned on before using the key/table method of storing the users session.

This is may not be the most elegent solution but it can get the job done. The disadvantage of course is having to re-code your application to pass the key along. You maybe able to create a find/replace though that could make it go fairly quickly.

Greg

>Hi Greg,
>
>What would you do if you absolutely can't use cookies? Most of our end users are mandated to have cookies turned off.
>
>I think this relates somewhat to a thread I just started "Session Timeouts" msgID# 83428.
>
>Thanks,
>
>Jacci
>
>
>>Depending upon the requirements of you application it maybe better to use a cookie instead of session variables for data you need to share between projects.
>>
>>I'm sure there is a more simple solution but in my experience session variables are scoped to the project/web and I don't know a way to get around this.
>>
>>>Hi again! I did some more testing with session varaibles between my projects and I have had no luck. It doesn't seem to matter if I'm crossing solutions, but the session variables are lost each time I cross projects. Each project starts it's own session, which in turn loses the value of session variables of any previous project(s). How can I pass the values of my session variables from one project to another?? Please help, this is really holding me up!!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform