Hide this comment

Hi,

OK - HttpContext.Current.Session is now available. When I do this in login form:

1
2
3
let u = Data.GetUser loginInfo.Name loginInfo.Password
HttpContext.Current.Session.Add("user", u)
let user = HttpContext.Current.Session.["user"] :?> Data.dbSchema.ServiceTypes.User

the user is set. So far so good. But when I go to another page and try to get user from Session again, I get null.
So am I missing something here?

Thank you,
Tomas

By on 4/30/2012 2:13 AM ()Reply
Hide this comment

It all depends on how your sitelet pages are constructed. Is your page (that you are navigating to after writing the Session state) computed once or per request?

By on 4/30/2012 4:22 PM ()Reply
Hide this comment

How can I say it? I don't set it anywhere. Basically my project is Sample Web Application (Sitelets).

By on 5/1/2012 12:27 AM ()Reply
Hide this comment

Consider the difference between these two:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module SampleSite =

    module Pages =
        // Page whose content is computed statically
        let HomePage : Content<Action> = ...

    let EntireSite =
        Sitelet.Infer <| fun action ->
            match action with
            | Action.Home ->
                    Pages.HomePage
            ...

type SampleWebsite() =
    interface IWebsite<SampleSite.Action> with
        member this.Sitelet = SampleSite.EntireSite
        member this.Actions = []

[<assembly: WebsiteAttribute(typeof<SampleWebsite>)>]
do ()

and

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module SampleSite =

    module Pages =
        // Page whose content is computed dynamically
        let HomePage () : Content<Action> = ...

    let EntireSite =
        Sitelet.Infer <| fun action ->
            match action with
            | Action.Home ->
                    Pages.HomePage ()
            ...

type SampleWebsite() =
    interface IWebsite<SampleSite.Action> with
        member this.Sitelet = SampleSite.EntireSite
        member this.Actions = []

[<assembly: WebsiteAttribute(typeof<SampleWebsite>)>]
do ()

In the former case, HomePage is computed once, in the latter case it is computed per request - enabling you to use contextual information (from a session or database, etc.)

By on 5/5/2012 1:36 PM ()Reply
Hide this comment

The issue appear only in Internet Explorer (using v9) when running from Visual Studio in two consequent runnings. On my deployment server it is OK, so I can live with this. Forget on it.
Thank you

By on 5/16/2012 8:16 AM ()Reply
Hide this comment

Is the HttpContext.Current.Session issue already fixed in latest 2.4.62 ? It seems to me that it is not by my test. This is still null reference:

1
HttpContext.Current.Session.Add("userInfo", anyObj)

in my Rpc function. Am I missing something?

By on 4/26/2012 3:27 AM ()Reply
Hide this comment

The fix will soon be published as 2.4.63. Thanks.

By on 4/27/2012 8:23 AM ()Reply
Hide this comment

And it's now on the WebSharper downloads page.

By on 4/27/2012 9:47 AM ()Reply
Hide this comment

Okay, sounds like HttpContext.Current.Session is now available to sitelet code but not to remote calls. I've reopened the ticked and am updating the Remote module as well: [link:bitbucket.org]

By on 4/26/2012 8:14 AM ()Reply
Hide this comment

Indeed, we are aware of this issue and have already fixed it in the final Q2 release coming out this week, after a few days of unforeseen delay. So the good news is that Session will now be available in your sitelet pages shortly.

By on 4/24/2012 8:14 AM ()Reply
Hide this comment

Unfortunately it was already found earlier:
[link:bitbucket.org]

I have more questions in this forum, which seems like bugs not found yet. These break my work, it is quite frustraiting although work with WebSharper is otherwise pleasure. I would need more support.

Thank you

By on 4/24/2012 6:43 AM ()Reply
Hide this comment

I am not sure if need dedicated support, it is option. Wouldn't it be better to solve problems here, with others? ;) I will need developer licence for commercial use anyway, is it right?
Thanks

By on 4/24/2012 2:22 PM ()Reply
Hide this comment

As far as I understand (do not trust me as you would a lawyer), AGPL allows free commercial open-source use. That is, if your app/website is open source then it can make money and not pay.

By on 4/25/2012 6:10 AM ()Reply
Hide this comment

And, put in a different way, if your app/website is closed source (doesn't matter whether it's free or not), you must get a developer license.

By on 4/25/2012 3:25 PM ()Reply
Hide this comment

If you need dedicated support, I suggest you look into our license and support options. Besides that, any closed source use of WebSharper requires a developer license, available in our WebSharper store.

By on 4/24/2012 8:19 AM ()Reply
Hide this comment

I believe you found a bug, thanks! I re-posted it here, fixing:

[link:bitbucket.org]

By on 4/24/2012 5:58 AM ()Reply
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper

Logging in...